3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: 1 ... 3 4 [5] 6 7

Author Topic: Addon : SystemShaders1_shx  (Read 26603 times)

« Reply #60 on: October 10, 2010, 05:24:26 AM »
v1.09 brings :

1. You can mirror UV by a simple script using iShaderFloatSet(OBJ_0,"MirrorUV",1) and link to skinmesh. (1.09 only)
2. You can tune global alpha for all shaders by using iShaderFloatSet(OBJ_0,"cAlpha",float) and link to skinmesh. (1.09 only)
3. you can tune emissive factor for all shaders by using iShaderFloatSet(OBJ_0,"cEmissive",float) and link to skinmesh. (1.09 only)
« Last Edit: October 11, 2010, 02:03:41 AM by shadmar »
« Reply #61 on: October 10, 2010, 01:47:35 PM »
Nice :)
« Reply #62 on: October 10, 2010, 03:08:02 PM »
Now also update at the library!
« Reply #63 on: October 18, 2010, 10:30:55 PM »
 ;D A little problem I ran into when adding more player cars to my project...
The shaders don't allow multi-mesh coloring.
I need to paint 6 different meshes a separate color in my project.
See attached project for example. (3drad 7.10)
Who knows, it just might be my graphics card spazzing.
« Reply #64 on: October 19, 2010, 12:13:41 AM »
They do, but you need to work abit for it.
First don't clone skinmesh using shft+a/q if it's shaded using _user_

If the 6 skinmeshes uses the same "user" shader just set coloring for each so the one you're coloring doesn't affect the other.

If you link all 6 skinmesh to a script you could do this if you only need to color one red and one blue:

iShaderFloat3Set(OBJ_0, "cColor", 2,1,1);  // color this one veeery red
iShaderFloat3Set(OBJ_22, "cColor", 0,0,1);  // color this one blueish
iShaderFloat3Set(OBJ_44, "cColor", 1,1,1);  // default color
iShaderFloat3Set(OBJ_66, "cColor", 1,1,1);  // default color
iShaderFloat3Set(OBJ_88, "cColor", 1,1,1);  // default color
iShaderFloat3Set(OBJ_110, "cColor", 1,1,1);  // default color
« Last Edit: October 19, 2010, 12:22:31 AM by shadmar »
« Reply #65 on: October 19, 2010, 09:42:08 AM »
Ok, thanks for helping me out.
Looks like alot of debugging for me.. I tried everything you said and my cars are still all the same color, except occasionally flickering the right color. I have a looping event timer that starts the paint script in case it fails at initialization.
Code: [Select]
////[Floats]\\\\____________________

float                  R=00.000;
float                  G=00.000;
float                  B=01.000;
float                 FS=00.000;
float                 FE=00.950;
float                 FM=00.350;
float                 FR=01.000;
float                 FG=01.000;
float                 FB=01.000;
float                 FW=01.000;
float                 R2=00.000;
float                 G2=00.000;
float                 B2=00.000;

float                Rp2=00.000;
float                Gp2=00.000;
float                Bp2=01.000;
float                FS2=00.000;
float                FE2=00.950;
float                FM2=00.350;
float                FR2=01.000;
float                FG2=01.000;
float                FB2=01.000;
float                FW2=01.000;
float                R22=00.000;
float                G22=00.000;
float                B22=00.000;

////[Strings]\\\\____________________

string               SR;
string               SG;
string               SB;
string               SFS;
string               SFE;
string               SFM;
string               SFR;
string               SFG;
string               SFB;
string               SFW;
string               SR2;
string               SG2;
string               SB2;

string               SRp2;
string               SGp2;
string               SBp2;
string               SFS2;
string               SFE2;
string               SFM2;
string               SFR2;
string               SFG2;
string               SFB2;
string               SFW2;
string               SR22;
string               SG22;
string               SB22;

int delay;
void Main()
{
if(iInitializing())
{iGlobalStringGet(SR,7);
iGlobalStringGet(SG,8);
iGlobalStringGet(SB,9);
iGlobalStringGet(SFS,10);
iGlobalStringGet(SFE,11);
iGlobalStringGet(SFM,12);
iGlobalStringGet(SFR,13);
iGlobalStringGet(SFG,14);
iGlobalStringGet(SFB,15);
iGlobalStringGet(SFW,16);
iGlobalStringGet(SR2,17);
iGlobalStringGet(SG2,18);
iGlobalStringGet(SB2,19);

iGlobalStringGet(SRp2,27);
iGlobalStringGet(SGp2,28);
iGlobalStringGet(SBp2,29);
iGlobalStringGet(SFS2,30);
iGlobalStringGet(SFE2,31);
iGlobalStringGet(SFM2,32);
iGlobalStringGet(SFR2,33);
iGlobalStringGet(SFG2,34);
iGlobalStringGet(SFB2,35);
iGlobalStringGet(SFW2,36);
iGlobalStringGet(SR22,37);
iGlobalStringGet(SG22,38);
iGlobalStringGet(SB22,39);

R=iStringVal(SR);
G=iStringVal(SG);
B=iStringVal(SB);
FS=iStringVal(SFS);
FE=iStringVal(SFE);
FM=iStringVal(SFM);
FR=iStringVal(SFR);
FG=iStringVal(SFG);
FB=iStringVal(SFB);
FW=iStringVal(SFW);
R2=iStringVal(SR2);
G2=iStringVal(SG2);
B2=iStringVal(SB2);

Rp2=iStringVal(SRp2);
Gp2=iStringVal(SGp2);
Bp2=iStringVal(SBp2);
FS2=iStringVal(SFS2);
FE2=iStringVal(SFE2);
FM2=iStringVal(SFM2);
FR2=iStringVal(SFR2);
FG2=iStringVal(SFG2);
FB2=iStringVal(SFB2);
FW2=iStringVal(SFW2);
R22=iStringVal(SR22);
G22=iStringVal(SG22);
B22=iStringVal(SB22);}

//Paint Player 1
iShaderFloat3Set(OBJ_0, "cColor", R,G,B);
iShaderFloatSet(OBJ_0, "Fresnel_Start", FS);
iShaderFloatSet(OBJ_0, "Fresnel_End", FE);
iShaderFloatSet(OBJ_0," Fresnel_Multiplier", FM);
iShaderFloat4Set(OBJ_0,"Fresnel_Color", FR,FG,FB,FW);
//iShaderFloat3Set(OBJ_22, "cColor", R2,G2,B2);

//Paint Player 2
iShaderFloat3Set(OBJ_220, "cColor", Rp2,Gp2,Bp2);
iShaderFloatSet(OBJ_220, "Fresnel_Start", FS2);
iShaderFloatSet(OBJ_220, "Fresnel_End", FE2);
iShaderFloatSet(OBJ_220," Fresnel_Multiplier", FM2);
iShaderFloat4Set(OBJ_220,"Fresnel_Color", FR2,FG2,FB2,FW2);
//iShaderFloat3Set(OBJ_22, "cColor", R22,G22,B22);


delay++;
if(delay>2)
{iObjectStart(OBJ_66);
iObjectStart(OBJ_110);
iObjectStart(OBJ_198);
iObjectStart(OBJ_176);
iScriptStop();}
}
It seems like using a different shader per car fixes it. But I still need edge gloss on all of my cars. :-\

Whenever I delete and replace the car body skinmesh on one car, it becomes the dominant color of all of them. ???
« Reply #66 on: October 19, 2010, 09:53:02 AM »
iShaderFloat3Set needs to be set in every loop, you have an iScriptStop() at the end there.
If you stop the script the shader will only remeber the last setting sent to the shader and your car will have the color for 1/60 of a second only.

Quote
Whenever I delete and replace the car body skinmesh on one car, it becomes the dominant color of all of them. ???
Yes it only remembers the last value sent to the shader, that's why you need to set it at every script loop and the car will have correct color runtime.

This is the script used to produce the colors below (they all use the same shader).:

void Main()
{
   iShaderFloat3Set(OBJ_0,"cColor",1,0,0);
   iShaderFloat3Set(OBJ_44,"cColor",1,1,2);
   iShaderFloat3Set(OBJ_66,"cColor",1,2,1);  // this will be the color of all when scripts isn't running or in edit mode
}

EDIT: When the script stops they will all be green since it's always the last value sent to the shader.
« Last Edit: October 19, 2010, 10:07:45 AM by shadmar »
« Reply #67 on: October 19, 2010, 10:05:16 AM »
 :P That was easy, just delete iScriptStop(); and everything works now.
Thanks! ;D
« Reply #68 on: October 19, 2010, 10:11:58 AM »
Great :)
« Reply #69 on: October 23, 2010, 12:50:36 PM »
A small bug in the 1.09, the smooth shaders doesn't calculate ambient correctly and is missing a normalize() which makes light fade when you scale the skinmesh.
I will correct this for v1.10.
« Reply #70 on: November 09, 2010, 03:12:34 AM »
Hi! I'm new to 3DRad and need some help with shaders. I only know that they are used on skinmeshes. (could u plz give me some more info on shaders?) I opened the skinmesh (i chose andro) dialog, and I chose a shader (say, 0002_pp_smooth_glossy [attached pic 1]) from the drop-down list and pressed OK. But the problem is, there seems no change in the skinmesh!!  ???  Moreover, when i went back to the dialog box, there was 0000_default again in the box of the drop-down list [attached pic 2]. What should i do?? i installed the "SystemShaders1_shx", but i got the same result.  :(  Plz help me. Also, as i'm "newbie", i don't know what UV is (you're talking about it always in this post). All the help is appreciated.

-Tanmay
« Reply #71 on: November 09, 2010, 07:38:20 AM »
@Tanmay Band
Your graphics card needs to support pixel shader 2.0 to display the shaders.
I'm guessing that is the problem.
« Reply #72 on: November 09, 2010, 08:50:35 AM »
All the systemshaders are SM2+
RAD's default shaders are 1.1 and 2.0 depending on what shader you use.
So if you gfx card is really old it won't work

ninkeon58

« Reply #73 on: November 09, 2010, 11:24:49 PM »
Oh yeah, I remember this problem! The same thing happens on my Geforce 2 because it only supports shader model 1.0 and 1.1.
« Reply #74 on: November 09, 2010, 11:45:57 PM »
Well, can u tell me which card is suitable for that?? i don't know what card i'm using currently....so...can u tell me how to find out?? ;D
« Last Edit: November 09, 2010, 11:55:41 PM by Tanmay Band »
Pages: 1 ... 3 4 [5] 6 7