x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Procedural Texture Generation

I am currently working on a Universe simulator. Currently working on methods to generate planet and moon surfaces procedurally.

I cant find any class regarding generating textures or materials in engine.

Can any one give me any leads?

Product Version: Not Selected
Tags:
more ▼

asked Nov 08 '14 at 03:28 AM in C++ Programming

avatar image

envenger
418 77 117 146

avatar image Omberone Nov 08 '14 at 12:55 PM

Sure. We had this issue just a short while ago, and it took some time coming up with a solution.

I'm going to write up a quick Wiki about it and post it here. Okay?

avatar image envenger Nov 08 '14 at 05:25 PM

Ok I will be waiting.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first
more ▼

answered Nov 08 '14 at 08:28 PM

avatar image

Omberone
314 16 17 33

avatar image Omberone Nov 10 '14 at 10:42 AM

Please mark as resolved if this solution works for you :)

avatar image EstherZuidgeest Sep 04 '15 at 02:05 PM

Hi omberone, I am trying to follow the article you wrote, but I have not clue where the code you present needs to reside. Can you provide some more information for c++ newbies? (does the code needs to be inside an actor? does it need to be stored in a specific place? etc)

avatar image Omberone Sep 05 '15 at 01:39 PM

It doesn't really matter as long as you can manipulate the dynamic material (ie, you need to have a reference to the dynamic material). We put this in an actor however since it suited us the best.

avatar image thebarryman Oct 13 '15 at 09:24 PM

Hi Omberone, thanks for this great resource. I was wondering if you could share a complete code sample along with the article? Many of the variables aren't declared within the scope of your code snippet and I'm wondering what types these should be, how they are declared, etc.

For example, how do I get the texture that I imported into the editor referenced in my C++ code? What data type should the list of materials be, or the list of colors? And how do I get the reference to the material I need to make a dynamic instance of?

It's been a long time since I used C++ at all and have never used Unreal before so diving in is a little daunting. Thanks so much for the help you've already provided.

avatar image Omberone Oct 14 '15 at 12:31 PM

Hey man, sure. I'll update the wiki with two files, one .h file and one .cpp file

avatar image thebarryman Oct 20 '15 at 11:50 PM

Awesome, thanks so much! I was able to get my texture updating with the help of your code.

avatar image envenger Nov 10 '14 at 09:40 PM

Thank you.. Awesome article. :)

avatar image Brandelan Aug 16 '15 at 03:26 AM

Has something become deprecated in the UpdateTextureRegions section of this code? When I attempt to set it up, I get a lot of unresolved external symbol errors.

avatar image Omberone Aug 16 '15 at 10:46 AM

This still works for us, could you copy paste your errors?

avatar image Brandelan Aug 16 '15 at 03:45 PM
 Here's the error"
 
 1>mapDynamicTexture.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: unsigned int __cdecl FRHIResource::AddRef(void)const " (__imp_?AddRef@FRHIResource@@QEBAIXZ) referenced in function "public: class TRefCountPtr __cdecl FTexture2DResource::GetTexture2DRHI(void)" (?GetTexture2DRHI@FTexture2DResource@@QEAA?AV?$TRefCountPtr@VFRHITexture2D@@@@XZ)
 1>mapDynamicTexture.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: unsigned int __cdecl FRHIResource::Release(void)const " (__imp_?Release@FRHIResource@@QEBAIXZ) referenced in function "public: __cdecl TRefCountPtr::~TRefCountPtr(void)" (??1?$TRefCountPtr@VFRHITexture2D@@@@QEAA@XZ)
 1>mapDynamicTexture.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl FRHICommandListImmediate::UpdateTexture2D(class FRHITexture2D *,unsigned int,struct FUpdateTextureRegion2D const &,unsigned int,unsigned char const *)" (__imp_?UpdateTexture2D@FRHICommandListImmediate@@QEAAXPEAVFRHITexture2D@@IAEBUFUpdateTextureRegion2D@@IPEBE@Z) referenced in function "public: void __cdecl `protected: void __cdecl AmapDynamicTexture::UpdateTextureRegions(class UTexture2D *,int,unsigned int,struct FUpdateTextureRegion2D *,unsigned int,unsigned int,unsigned char *,bool)'::`5'::EURCMacro_UpdateTextureRegionsData::DoTask(enum ENamedThreads::Type,class TRefCountPtr const &)" (?DoTask@EURCMacro_UpdateTextureRegionsData@?4??UpdateTextureRegions@AmapDynamicTexture@@IEAAXPEAVUTexture2D@@HIPEAUFUpdateTextureRegion2D@@IIPEAE_N@Z@QEAAXW4Type@ENamedThreads@@AEBV?$TRefCountPtr@VFGraphEvent@@@@@Z)

avatar image Brandelan Aug 16 '15 at 03:46 PM
 1>mapDynamicTexture.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static enum ENamedThreads::Type __cdecl FRenderCommand::GetDesiredThread(void)" (__imp_?GetDesiredThread@FRenderCommand@@SA?AW4Type@ENamedThreads@@XZ) referenced in function "private: void __cdecl TGraphTask::SetupPrereqs(class TArray,class TInlineAllocator<4,class FDefaultAllocator> > const *,enum ENamedThreads::Type,bool)" (?SetupPrereqs@?$TGraphTask@VEURCMacro_UpdateTextureRegionsData@?4??UpdateTextureRegions@AmapDynamicTexture@@IEAAXPEAVUTexture2D@@HIPEAUFUpdateTextureRegion2D@@IIPEAE_N@Z@@@AEAAXPEBV?$TArray@V?$TRefCountPtr@VFGraphEvent@@@@V?$TInlineAllocator@$03VFDefaultAllocator@@@@@@W4Type@ENamedThreads@@_N@Z)
 1>mapDynamicTexture.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static enum ESubsequentsMode::Type __cdecl FRenderCommand::GetSubsequentsMode(void)" (__imp_?GetSubsequentsMode@FRenderCommand@@SA?AW4Type@ESubsequentsMode@@XZ) referenced in function "public: static class TGraphTask::FConstructor __cdecl TGraphTask::CreateTask(class TArray,class TInlineAllocator<4,class FDefaultAllocator> > const *,enum ENamedThreads::Type)" 

avatar image Brandelan Aug 16 '15 at 03:46 PM
 (?CreateTask@?$TGraphTask@VEURCMacro_UpdateTextureRegionsData@?4??UpdateTextureRegions@AmapDynamicTexture@@IEAAXPEAVUTexture2D@@HIPEAUFUpdateTextureRegion2D@@IIPEAE_N@Z@@@SA?AVFConstructor@1@PEBV?$TArray@V?$TRefCountPtr@VFGraphEvent@@@@V?$TInlineAllocator@$03VFDefaultAllocator@@@@@@W4Type@ENamedThreads@@@Z)
 1>mapDynamicTexture.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class FRHICommandListImmediate & __cdecl GetImmediateCommandList_ForRenderCommand(void)" (__imp_?GetImmediateCommandList_ForRenderCommand@@YAAEAVFRHICommandListImmediate@@XZ) referenced in function "public: void __cdecl `protected: void __cdecl AmapDynamicTexture::UpdateTextureRegions(class UTexture2D *,int,unsigned int,struct FUpdateTextureRegion2D *,unsigned int,unsigned int,unsigned char *,bool)'::`5'::EURCMacro_UpdateTextureRegionsData::DoTask(enum ENamedThreads::Type,class TRefCountPtr<class FGraphEvent> const &)" (?DoTask@EURCMacro_UpdateTextureRegionsData@?4??UpdateTextureRegions@AmapDynamicTexture@@IEAAXPEAVUTexture2D@@HIPEAUFUpdateTextureRegion2D@@IIPEAE_N@Z@QEAAXW4Type@ENamedThreads@@AEBV?$TRefCountPtr@VFGraphEvent@@@@@Z)
 1>mapDynamicTexture.cpp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class FRHICommandListExecutor GRHICommandList" (__imp_?GRHICommandList@@3VFRHICommandListExecutor@@A)
 1>mapDynamicTexture.cpp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) bool GIsThreadedRendering" (__imp_?GIsThreadedRendering@@3_NA)
 1>mapDynamicTexture.cpp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) bool GMainThreadBlockedOnRenderThread" (__imp_?GMainThreadBlockedOnRenderThread@@3_NA)

avatar image Omberone Aug 16 '15 at 05:53 PM

Looks like you're missing a module. Make sure you have all of the following (not sure which one addresses this linker issue);

  PrivateDependencyModuleNames.AddRange(
             new string[] { 
                 "RenderCore",
                 "ShaderCore",
                 "RHI",
             });


If you're not aware, this goes into your "Project".Build.cs file

avatar image Brandelan Aug 16 '15 at 06:46 PM

Awesome. Will check that out soon. Thanks. :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question