Hello,
I followed the discussion about the rendering order
but it is not clear to me how it was solved (enhex’s hellbreaker is fantastic).
My first attempt was to replicate the code proposed by enhex (I used actionscript) but SetRenderOrder still doesn’t work or I’m doing something wrong, in 18_CharacterDemo.as:CreateCharacter ()
Node @ xNode = characterNode.CreateChild ("test");
xNode.scale = Vector3 (0.25f, 0.25f, 1.0f);
xNode.position = Vector3 (0.5f, 0.9f, 1.5f);
StaticModel @ xobject = xNode.CreateComponent ("StaticModel");
xobject.model = cache.GetResource ("Model", "Models / Box.mdl");
xobject.castShadows = true;
// (is there a way in actionscript to use clone () without declaring two variables?)
Material @ mat = cache.GetResource ("Material", "Materials / Jack2.xml");
Material @ mat2 = mat.Clone ();
mat2.renderOrder = 200;
Technique @ tec = mat2.techniqueEntries [0] .technique;
Technique @ tec2 = tec.Clone ();
Pass @ pass = tec2.GetPass (tec2.passNames [0]);
pass.depthTestMode = CMP_ALWAYS;
xobject.material = mat2;
As a second attempt I duplicated the Material and the Technique, but I am not yet confident with the urho render pipeline and materials, I enabled DumpResources on exit and I see that the updated material and technique are used:
Materials / Jack2.xml
Techniques / NoTexture2.xml
I see the shaders that are used:
Shaders / GLSL / Shadow.glsl
Shaders / GLSL / LitSolid.glsl
Shaders / GLSL / Basic.glsl
it is not clear to me where to intervene to associate a custom shader to the Jack2 material (notexture has the attribute vs only for depth and shadow and depth is not even used ??)
I think the weapon is a fairly common requirement for a FPS, it would be nice to have a working example.
edit
Somehow I missed the fact that the notexture technique element has the vs attribute, I modified it and I see that the specified shader is loaded (Shaders / GLSL / LitSolid2.glsl)
I tried modifying VS with gl_Position.z * = 0.999 or gl_Position.z * = 0.01 but I don’t see changes, do I have to change anything else?