develop mode

Started by
9 comments, last by Shaarigan 7 years, 6 months ago

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 ?

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.

Aether3D Game Engine: https://github.com/bioglaze/aether3d

Blog: http://twiren.kapsi.fi/blog.html

Control

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

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.

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.

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 ..

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

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

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

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.

http://www.tenouk.com/ModuleBB.html

This topic is closed to new replies.

Advertisement