• Create Account

### #ActualNightCreature83

Posted 31 July 2012 - 09:12 AM

One of the things I like about the design here is that I can define material parameters in an XML-like file, e.g.:

<Material>
<Parameter name="uniformA" type="float">1.0</Parameter>
<Parameter name="uniformB" type="int">5</Parameter>
</Material>


Using UBOs, there doesn't seem to be a way to get the names of the uniforms inside a block - just the name of the block itself. Could anyone suggest a way of integrating UBOs with a material file format like this?

Cheers.

Well you could use a block construct arround parameters like this
<Material>
<UBO name="uniform_block_1">
<Parameter name="uniformA" type="float">1.0</Parameter>
<Parameter name="uniformB" type="int">5</Parameter>
</UBO>
</Material>


The point is that you don't really need a name for the uniforms any more, they are just a memory area that maps to the UBO that has a structure the shader expects to have. But in the layout I used you could ignore the block tag and just use the uniforms inside if the card you were running on doesn't support UBO's.

### #1NightCreature83

Posted 31 July 2012 - 09:11 AM

One of the things I like about the design here is that I can define material parameters in an XML-like file, e.g.:

<Material>
<Parameter name="uniformA" type="float">1.0</Parameter>
<Parameter name="uniformB" type="int">5</Parameter>
</Material>


Using UBOs, there doesn't seem to be a way to get the names of the uniforms inside a block - just the name of the block itself. Could anyone suggest a way of integrating UBOs with a material file format like this?

Cheers.

Well you could use a block construct arround parameters like this
<Material>