Jump to content
  • Advertisement
Sign in to follow this  
poigwym

develop mode

This topic is 711 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I 'm curious about is there a method to recompile game and use resource that have been loaded before? I waste great deal of time on loading 

resource again and again.  I have few models,  and tons of shader, the shaders must be compiled real time.

The fucking thing is  my computer runs slowly, which wastes me tons of time. 

I modify  engine  not logic code, so I can't use script.

Who know how to cache the loaded resource ?  

Edited by poigwym

Share this post


Link to post
Share on other sites
Advertisement

The question is a bit unclear and the answer depends entirely of your engine architecture/libraries/programming languages but generally yes, shaders can be compiled as a pre-processing step, textures can be compressed etc. just once and used many times.

Share this post


Link to post
Share on other sites

Sorry to say that my question was a bit unclear , One process load shaders and texture into RAM.  And engine is another process.

 I may often modify my engine and recompile. I wish the  Engine can use those resource in RAM directly rather than loading resource itself.

Edited by frob
Revert some newly-added unnecessary profanities.

Share this post


Link to post
Share on other sites

the shaders must be compiled real time

Why? If possible, you should pre-compile them and load binary shaders at runtime, which is very fast.
 
As for the above suggestions of code reloading... you can do this for "engine" code too, if your engine is in a DLL.

Share this post


Link to post
Share on other sites

Use the f****** dlopen or LoadLibrary.

It require me to create d3ddevice, d3dcontext in that dll.


 

the shaders must be compiled real time

Why? If possible, you should pre-compile them and load binary shaders at runtime, which is very fast.
 
As for the above suggestions of code reloading... you can do this for "engine" code too, if your engine is in a DLL.

 

 

some shader should be compile real time, depend on the Macro that pass into shader, Macro will be different. I 'm not sure ..

Edited by poigwym

Share this post


Link to post
Share on other sites

some shader should be compile real time, depend on the Macro that pass into shader, Macro will be different. I 'm not sure ..

That is why you play the game, log all the macro combinations you get, and cache those results for later.


L. Spiro

Edited by L. Spiro

Share this post


Link to post
Share on other sites

If you want a swap n go mechanism in your engine in general the pervisous writers are right, you then need LoadLibrary function in it. But to get this working it is a design question of how you build your engine modules to make swap n go working, managin threads carefully to not run into null pointer exception when calling a module swap and so on. You also need some kind of abstraction layer  to bind your functions to.

 

The other section is the resource one. Shaders may be saved in some graphics APIs and then reloaded that has nothing to do with macros because they were loaded when you have swapped your code so to restore them should not be the problem. Textures and anything in memory needs to be reloaded when swapping except for non-pointer or straight strict pointer addresses e.g. pointing into a memory bucket you handle by your own. A memory manager could also help because you are able to serialize it to disk and reload it after you restart the app.

 

I have also written some kind of reflection for my engine capable to call functions and set fields on existing objects I use for realtime editing when testing gameplay.

 

There are bunches of possibilities you may use but anyway it is a design question

Share this post


Link to post
Share on other sites

 

 

Shaders may be saved in some graphics APIs and then reloaded that has nothing to do with macros because they were loaded when you have swapped your code so to restore them should not be the problem. T

Loading shaders has nothing to do with macros. But compiling shaders does.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!