|
Re: Ulitimate lighting shader pack v1.0
[Re: Drew]
#36873
12/03/04 04:31
12/03/04 04:31
|
Joined: Sep 2003
Posts: 27 FL, USA (by way of Bonnie Scot...
Gazzbass
Newbie
|
Newbie
Joined: Sep 2003
Posts: 27
FL, USA (by way of Bonnie Scot...
|
Drew, Absolutely stunning stuff by yourself and Steempipe! Awesome! I have a couple of notes. I noticed in the mat_lighting.wdl that you had commented that only two lights work. I think this is because the shader code in normalmap_level_ps2.0.fx only makes provisions for two lights, i.e.: Code:
float4 PS_PASS0( PS_INPUT0 psInStruct ):COLOR
{ float4 color = tex2D(sColorMap, psInStruct.Tex); // fetch color map float3 bumpNormal = 2 * (tex2D(sBumpMap, psInStruct.Tex) - 0.5); // fetch bump map float4 gloss = tex2D( sBumpMap, psInStruct.Tex ); //LIGHT 1 float3 LightDir1 = normalize(psInStruct.Light1); float3 ViewDir1 = normalize(psInStruct.View1); float4 diff1 = saturate(dot(bumpNormal, LightDir1)); // diffuse component float shadow1 = saturate(4 * diff1); float3 Reflect1 = normalize(2 * diff1 * bumpNormal - LightDir1); // R float4 spec1 = pow(saturate(dot(Reflect1, ViewDir1)), 15); float4 Attenuation1 = saturate(dot(psInStruct.Att1, psInStruct.Att1)); //LIGHT2 float3 LightDir2 = normalize(psInStruct.Light2); float3 ViewDir2 = normalize(psInStruct.View2); float4 diff2 = saturate(dot(bumpNormal, LightDir2)); // diffuse component float shadow2 = saturate(4 * diff2); float3 Reflect2 = normalize(2 * diff2 * bumpNormal - LightDir2); // R float4 spec2 = pow(saturate(dot(Reflect2, ViewDir2)), 15); float4 Attenuation2 = saturate(dot(psInStruct.Att2, psInStruct.Att2)); return ( (0.1 * color) + //ambient ((shadow1 * (color * diff1 + (spec1*gloss.w)) * (1 -Attenuation1))*vecLightColor[1])+ ((shadow2 * (color * diff2 + (spec2*gloss.w)) * (1 -Attenuation2))*vecLightColor[2]) ); }
I guess its just a case of copying the code and pasting, then changing things like LightDir2 to LightDir3 and ViewDir2 to ViewDir3 etc. Also, I altered the code within the light_pos_object action in mat_lighting.wdl to accomodate the new template scripts, since the demo came with the old ones. Code:
var light_dist=2700; //Distance Light LOD...how far away from a light you can be until it shuts off/on
action light_pos_object { wait(5); my.invisible=on; my.passable=on; //NewtonCreateGravityEntity (wood_material); while(1) {
if vec_dist(my.x, plBiped01_entity.x )<light_dist// or camera { my.light=on; my.lightrange=1800; //could be set also to a skill my.red= my.skill1; //just put in the r,g,b values my.green= my.skill2; my.blue= my.skill3; my.cast=on; //casts a shadow when on } else { my.lightrange=0; //if too far away turn it off my.light=off; my.cast=off;
} wait(1); }
Hopefully this is the start of something BIG for 3DGS. I've been using it on and off since A4.12 but only recently got up a head of steam. It must be said that the Commercial Edition, at $199 is a total bargain considering what this development studio is capable of!
|
|
|
Re: Ulitimate lighting shader pack v1.0
[Re: DARKLORD]
#36874
12/03/04 04:40
12/03/04 04:40
|
Joined: Sep 2003
Posts: 27 FL, USA (by way of Bonnie Scot...
Gazzbass
Newbie
|
Newbie
Joined: Sep 2003
Posts: 27
FL, USA (by way of Bonnie Scot...
|
I had a similar problem, but I realised something was wrong when I got an empty pointer error "player.x", which is used in the old templates. I am using the new templates. See post HERE I also just got a new GeForce 6800GT, and I changed some of the shader code to PS3.0 (i.e. changed TEXCOORD2 to TEXCOORD1 in the vertex and pixel shader input STRUCTS, then in the technique two_pass section, I changed VertexShader = compile vs_2_0 VS_PASS0(); PixelShader = compile ps_2_0 PS_PASS0(); to VertexShader = compile vs_3_0 VS_PASS0(); PixelShader = compile ps_3_0 PS_PASS0(); I realise this limits potential customers somewhat at the moment, but I wanted to see the effect in all its glory so to speak!!! Hope this helps some!
|
|
|
Re: Ulitimate lighting shader pack v1.0
[Re: TheExpert]
#36878
12/03/04 07:16
12/03/04 07:16
|
Joined: Oct 2002
Posts: 955
danthaman015
Developer
|
Developer
Joined: Oct 2002
Posts: 955
|
Hmm Drew I downloaded your demo and it works but I don't see the shaders working. The rooms just bright. I thought it would work, I tested on two computers, one is a Radeon 9200 which does support shaders... is there something I need to download?
Thanks, Dan
**On break**
|
|
|
Re: Ulitimate lighting shader pack v1.0
[Re: danthaman015]
#36880
12/03/04 07:54
12/03/04 07:54
|
Joined: Dec 2003
Posts: 1,097 Maryland, USA
Steempipe
Serious User
|
Serious User
Joined: Dec 2003
Posts: 1,097
Maryland, USA
|
Quote:
Hmm Drew I downloaded your demo and it works but I don't see the shaders working. The rooms just bright. I thought it would work, I tested on two computers, one is a Radeon 9200 which does support shaders... is there something I need to download?
Thanks, Dan
9200 supports pixelshader.1.4. The card needs to support 2.0 or better.
|
|
|
Re: Ulitimate lighting shader pack v1.0
[Re: Steempipe]
#36881
12/03/04 07:59
12/03/04 07:59
|
Joined: Sep 2004
Posts: 1,214 Austin, Texas
Josh_Arldt
Senior Developer
|
Senior Developer
Joined: Sep 2004
Posts: 1,214
Austin, Texas
|
Quote:
9200 supports pixelshader.1.4. The card needs to support 2.0 or better.
LOL, I don't know very much about ATI cards. 
|
|
|
|