Horde3D
http://horde3d.org/forums/

Some rendering questions
http://horde3d.org/forums/viewtopic.php?f=2&t=339
Page 1 of 1

Author:  roarflolo [ 20.05.2008, 18:57 ]
Post subject:  Some rendering questions

Shouldn't these be properties of the material instead of the context? I'll end up with quite a lot of duplicated GLSL code... or am I missing something?
Code:
writeDepth     enable writing to depth buffer (Values: false, true) (Default: true) {optional}
blendMode    blend function (Values: REPLACE, BLEND, ADD, ADD_BLENDED, MULT) (Default: REPLACE) {optional}


Where is the testDepth property to enable/disable depth testing?

Where is the property to control backface culling?

Is there support for sorting of some objects to be rendered back-to-front relative to the camera?

Is there support for 'rendering layers' where I can define groups/layers of objects, and the render-order of these groups/layers?

Author:  marciano [ 20.05.2008, 20:21 ]
Post subject:  Re: Some rendering questions

Hi roarflolo,

roarflolo wrote:
Shouldn't these be properties of the material instead of the context? I'll end up with quite a lot of duplicated GLSL code... or am I missing something?
Code:
writeDepth     enable writing to depth buffer (Values: false, true) (Default: true) {optional}
blendMode    blend function (Values: REPLACE, BLEND, ADD, ADD_BLENDED, MULT) (Default: REPLACE) {optional}

It makes sense that they are different for the contexts. A light pass should be additive while the ambient or early-z pass uses no blending (all contexts).

roarflolo wrote:
Where is the testDepth property to enable/disable depth testing?

Where is the property to control backface culling?

Yeah these are still missing but should be trivial to add.

roarflolo wrote:
Is there support for sorting of some objects to be rendered back-to-front relative to the camera?

Yes, this can be done in the pipeline (see pipeline docs).

roarflolo wrote:
Is there support for 'rendering layers' where I can define groups/layers of objects, and the render-order of these groups/layers?

You can realize such things with the pipeline in combination with the material classes. Have a look at the sample pipelines where translucent objects get special processing.

Author:  roarflolo [ 20.05.2008, 22:10 ]
Post subject:  Re: Some rendering questions

I admit I haven't read the pipeline/shader/material documentation properly yet... :) but does this make sense

Code:
<Material>
  <RenderConfig context="AMBIENT" writeDepth="true" blendMode="ADD" />
  <RenderConfig context="LIGHTING" writeDepth="false" blendMode="REPLACE" />
  <Shader source="standard.shader.xml" />
  <TexUnit unit="0" map="10m_build_01.png" />
</Material>


The reason I have a problem with these properties in the context is that the GLSL code is there as well, duplicating it, which makes it very hard to maintain once you get a few variations.

Author:  marciano [ 22.05.2008, 08:48 ]
Post subject:  Re: Some rendering questions

You will usually have clearly more materials than shaders. With your proposal you would have to add the context information manually to all materials (ColladaConv can't do that automatically), so this is real duplicatation effort ;)
Furthermore, I don't think that the blending params will usually vary so much for a shader context.

Author:  roarflolo [ 22.05.2008, 09:40 ]
Post subject:  Re: Some rendering questions

This information is in the Collada files (from Max or Maya materials) so the Collada converter can do this automatically.

Author:  kal [ 22.05.2008, 18:49 ]
Post subject:  Re: Some rendering questions

is there an easy way to make a material that uses 3 maps(diffuse,normal,specular) or do I need to create a shader myself for the material (thanks to parallax.shader I already have one for diffuse+normal, but too shiny :P )

Author:  swiftcoder [ 22.05.2008, 18:51 ]
Post subject:  Re: Some rendering questions

kal wrote:
is there an easy way to make a material that uses 3 maps(diffuse,normal,specular) or do I need to create a shader myself for the material (thanks to parallax.shader I already have one for diffuse+normal, but too shiny :P )

You will need to create your own shader - but you should be able to copy/paste from parallax.shader and just add a couple of lines of code.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/