ksubox
Member
|
User shaders, materials and so...
Hi,
Recently I try to understand how to deal with shaders, but lost in space.
I found VtxInput structure with many elements, like:
mVec _hlp :ATTR1;
or
lVec4 _material:ATTR10;
But I didn't find any description what is it and how to set from C++.
I suspect it somehow rely on mesh flags like VTX_HLP or VTX_TEX1 and some material properties, but it's absolutely unclear how material's base_0, base_1, detail_map, macro_map, reflection_map, light_map (totally 6) will be mapped to _tex, _tex1, _tex2 (totally 3) textures.
I definitely need help to understand.
If Grzegorz could make some comments in shader headers and corresponding Mesh/Material headers it would be nice.
Also I found many conditional definitions in shader headers, for example DeferredSolidOutput doesn't have Vec4 out3:COLOR3; for GLSL. This member is used for depth output. Does it mean I will not have depth output on OpenGL platform (OSX) ? Is this structure useful only for deferred renderer ? And what outputs are supported in pixel shader for every renderer (Simple, Forward, Deferred)?
(This post was last modified: 07-24-2013 09:22 AM by ksubox.)
|
|
07-24-2013 05:07 AM |
|
Rubeus
Member
|
RE: User shaders, materials and so...
I believe the shader language in Esenthel is based on HLSL.
|
|
07-24-2013 09:11 PM |
|
ksubox
Member
|
RE: User shaders, materials and so...
Yes, I realised it's HLSL (which is actually Cg), but anyway I didn't find clear description of EE bindings (inputs & outputs) for shaders, so I don't know mapping of C++ objects to shader parameters.
|
|
07-25-2013 08:33 AM |
|
Esenthel
Administrator
|
RE: User shaders, materials and so...
Hi,
I recommend checking some of the shader tutorials from EE 1.0, they cover creation of many shaders.
"out3:COLOR3" in non-DX9 you don't need to manually output the depth, because it's read-back from the depth buffer. (on DX9 not always the depth buffer is readable, hence the need for writing it to a render target)
|
|
07-25-2013 11:29 AM |
|