I put a sample shader at http://www.geocities.jp/nyankko15/DAZStudio/tmp/doublesidetest.zip
It contains sourcecode.
keypoint are 2.
1. code : Shader.setIntegerAttrib(“sides”, “integer doubleshaded”,1);
2. in shader suorce code
determine whetter it is forward sourface or reverse surafce
by sign = sign(N.Ng);
float sign = sign(N.Ng);
Oi = Ot;
Ci = Oi*Ct;
Oi = rOt;
Ci = Oi*rCt;
by this shader , I can set forward color , forward opacity, reverse color ,reverse opacity.
If I apply this shader to sphere and
set forward color red and revers color blue and forward opacity 1 then sphere is painted by red
and if set forward opacity 0 then shpere is painted by blue,
but if I apply this shader to Genesis,
If I set forward opacity 0 then Genesis is not painted.transparency at all.
It should be painted blue.
By this result , I think
sign = sign(N.Ng);
is >= 0 allways
I wonder why this is occure.
Perhaps keypoint 1 does not work against Genesis.
About Genesis , RIB structure is deferent from other figures.
When I set renderoption to RIB output, I can see Genesis
structure is deferent from other figures.
I think it affect to keypoint1.
If I converted(Exported) Genesis to Poser and load on DS4
then the shader works . Because exporeted Genesis’s Structure
is same as other figures.
But Exproted Genesis is not good for DS4.
Perhaps there is a way to use double side shadiing against Genesis sturucture
I want to know the way how to do it. Realy very very much.
Thank you for your reading, thinking.
PS this shader is generated by Eilir (for DS2) and compiled by DS4’s RSL Editor