Horde3D

Next-Generation Graphics Engine
It is currently 25.11.2024, 21:35

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 27.12.2008, 11:10 
Offline

Joined: 19.11.2007, 19:35
Posts: 218
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.


Top
 Profile  
Reply with quote  
PostPosted: 27.12.2008, 12:33 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
This would be very handy, and would save having to duplicate the entire resource directory for each shader model one supports.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group