Horde3D http://horde3d.org/forums/ |
|
EngineOption - Spec. and shaders http://horde3d.org/forums/viewtopic.php?f=8&t=588 |
Page 1 of 1 |
Author: | AcidFaucet [ 27.12.2008, 11:10 ] |
Post subject: | EngineOption - Spec. and shaders |
It seems like it would be worthwhile to add something along the lines of a "ShaderSpec" to the engine options and then adding a "spec='int'" param to shader definitions in materials. Object being that the loader would be modified to only define a new resource for the highest available spec allowed by the engine option, or load whatever is there if spec is left undefined. Code: <Material class="Translucent.MyClass"> <Shader source="myshader.shader.xml" spec="3"/> <Shader source="myMedShader.shader.xml" spec="2" /> <Shader source="myLowShader.shader.xml spec="1" /> <TexUnit unit="0" map="mytex.jpg" /> <Uniform name="myColor" a="1.0" b="1.0" c="0.5" /> </Material> If a shader is defined that doesn't have a spec specified and another shader is also defined but it has a spec then the shader with a spec is only used if the defined engine option exactly matches it, otherwise the shader without a defined spec is used. Hence: Code: <Material class="Translucent.MyClass"> <Shader source="myshader.shader.xml" /> <Shader source="myLowShader.shader.xml spec="1" /> <TexUnit unit="0" map="mytex.jpg" /> <Uniform name="myColor" a="1.0" b="1.0" c="0.5" /> </Material> The above would use "myshader.shader.xml" for specs 3 and 2, and myLowShader.xml for spec 1. Not an essential capability but a practical one. Could be implemented for textures too. Though I suppose you could accomplish something of the like with the pipelines using stage activations and classes. |
Author: | swiftcoder [ 27.12.2008, 12:33 ] |
Post subject: | Re: EngineOption - Spec. and shaders |
This would be very handy, and would save having to duplicate the entire resource directory for each shader model one supports. |
Page 1 of 1 | All times are UTC + 1 hour |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |