Jump to content

Possible to change shader?


photo

Recommended Posts

Hello @weibo.xie!

Both built-in shaders and Base materials referring to them are stored in the data/core.ung archive in your project's folder. You can find the source files in the %Unigine_SDK_Browser%/sdks/%CURRENT_SDK%/data/core folder.

Please consider the fact that some UNIGINE materials (e.g. mesh_base.basemat) have the traditional xml-based format and refer to separate shader files, while other materials (such as particles_base.basemat) have been migrated to the new ULON format with embedded shader code.

To change a built-in material/shader for tests, you can copy it from the SDK folder to your data folder while retaining its location (e.g. place at data/core/shaders/mesh/shadow.shader the same way it is placed in the Sdk), thus it will override the same resource stored in core.ung.

After making changes to the shader source code, execute the shaders_reload console command to bring the updates. Please note that starting with UNIGINE 2.13 you should use the materials_reload command for reloading both materials and shaders.

Tnahk you!

  • Like 1
Link to comment
35 minutes ago, thomalex said:

Hello @weibo.xie!

Both built-in shaders and Base materials referring to them are stored in the data/core.ung archive in your project's folder. You can find the source files in the %Unigine_SDK_Browser%/sdks/%CURRENT_SDK%/data/core folder.

Please consider the fact that some UNIGINE materials (e.g. mesh_base.basemat) have the traditional xml-based format and refer to separate shader files, while other materials (such as particles_base.basemat) have been migrated to the new ULON format with embedded shader code.

To change a built-in material/shader for tests, you can copy it from the SDK folder to your data folder while retaining its location (e.g. place at data/core/shaders/mesh/shadow.shader the same way it is placed in the Sdk), thus it will override the same resource stored in core.ung.

After making changes to the shader source code, execute the shaders_reload console command to bring the updates. Please note that starting with UNIGINE 2.13 you should use the materials_reload command for reloading both materials and shaders.

Tnahk you!

Cool! You make everything clear and it works.

Thank you very much!

Link to comment
×
×
  • Create New...