About Store Forum Documentation Contact



Post Reply 
User shaders, materials and so...
Author Message
ksubox Offline
Member

Post: #1
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
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #2
RE: User shaders, materials and so...
I believe the shader language in Esenthel is based on HLSL.
07-24-2013 09:11 PM
Find all posts by this user Quote this message in a reply
ksubox Offline
Member

Post: #3
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
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
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
Find all posts by this user Quote this message in a reply
Post Reply