i want my engine to support shaders. it is the first time that i get in touch with shaders, and i am not sure what kind of features i will support... how do your shader systems work? can you guys post examples of your shaders?
Here's mine:
# this is just a pseudo-grammar-language...
# comments start with '#' :)
depthvalue ="never"|("none"|"always")|"less"|"lequal"|"equal"|"gequal"|
"greater"|"notequal"
alphavalue ="never"|("none"|"always")|"less" ref |"lequal" ref|
"equal" ref|"gequal" ref| "greater" ref|"notequal" ref
"shader" name
{
"cull" = "front"|"back"|"none" # default=front
"fog" = bool # default=0
"type" = "sky"|"water"|"none" # default=none
"layer" level { # level ranges from 0..7
"depthfunc" = depthvalue # default=always
"depthwrite" = bool
"alphafunc" = alphavalue # default=always
"blendfunc" = blendvalue
"texturemap" = name
"shininess" = 0..128
"specular" = 0..255 0..255 0..255 0..255 # default 0 0 0 255
"emissive" = 0..255 0..255 0..255 0..255
"type" = "decal"|"detail"|"none"|"bumpmap"|"envmap" # default=none
}
}
a shader can have several layers of textures, each layer with his own material, depth- alpha- and blend-function. it is based on the tutorials at http://www.racer.nl/...e/shadereng.htm.
that's it, comments are welcome!
Chris












