genesis and double side shading feature (question)
nyanyan
Posts: 22
I want to know how to use double side shading feature of 3Dlight in DS4 against genesis.
My shader uses double side shading feature of 3Dlight in DAZ Studio4.
It works for A3, belbel, V4,and so on.
But it does not work for genesis.
If anyone show me code how to do it, I am very very very happy.
Thank you for your reading.
Post edited by nyanyan on
Comments
It should just work, especially if it works for some items. What exactly are you doing, and what are you getting as as result?
If you have the DS4.5 release candidate it contains the Ambient Occlusion scripted renderer scripts that do include a command about double-sided surfaces.
However, since it works for you for older figures, it's probably just a Genesis bug.
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);
where: scripts/support/Eilir/s2_test/s2_simple_surfaceAttribs.ds
2. in shader suorce code
determine whetter it is forward sourface or reverse surafce
by sign = sign(N.Ng);
code snippet:
float sign = sign(N.Ng);
....
if(sign >=0){
Oi = Ot;
Ci = Oi*Ct;
}else{
Oi = rOt;
Ci = Oi*rCt;
}
result:
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
I found this in My Library/shaders/s2_test/s2_test.ds which may be one of the culprits:
I'm not knowledgeable enough to fix it myself. :-S
I'm not sure if that is the root, but if it is you might try something like this instead of var oObject = oNode.getObject();
However, I think that would risk rendering the same object multiple times - if possible it would be better to handle this at the nod gathering stage, so that there was a single oNode for each Genesis (or other TriAx) figure, rather than one for each bone.
Thank you for your reply.
I have not enough knowledge but I will try as soon as I can have time.
I tried
then
Sorry, that's what comes of working from memory - getFigure() should be getSkeleton()
Thank you.
But result of rendering is the same as original script.
if forward opacity is 0% then not painted at all ( reverse opacity is 100%)
where it should be painted by reverse color.
If forward opacity is 100% then painted by foward color.
I'd file a bug report and/or send a PM to ketthrove, he's the most likely to know what is wrong.
Ah, yeah
But Eilir is a free soft , and commercial version of it is a shader mixer and shader builder.
He has no responsibility to do anything at all.