Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (ozgur, TipmyPip, AndrewAMD), 1,209 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 3
Page 11 of 24 1 2 9 10 11 12 13 23 24
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 Offline
Newbie
Gazzbass  Offline
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 Offline
Newbie
Gazzbass  Offline
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: Drew] #36875
12/03/04 04:47
12/03/04 04:47
Joined: Sep 2003
Posts: 27
FL, USA (by way of Bonnie Scot...
Gazzbass Offline
Newbie
Gazzbass  Offline
Newbie

Joined: Sep 2003
Posts: 27
FL, USA (by way of Bonnie Scot...
I got a nice ice effect with the shader, too! Its good stuff... pity we're limited to 8 dynamic lights...



Ooohhh, looks slippy!!!

Re: Ulitimate lighting shader pack v1.0 [Re: Gazzbass] #36876
12/03/04 05:37
12/03/04 05:37
Joined: Sep 2003
Posts: 27
FL, USA (by way of Bonnie Scot...
Gazzbass Offline
Newbie
Gazzbass  Offline
Newbie

Joined: Sep 2003
Posts: 27
FL, USA (by way of Bonnie Scot...
Well, the copying and pasting of shader code with a change in subscript numbers didn't work... think its time to get me a book on DX9 shader programming instead of making guesses...

Re: Ulitimate lighting shader pack v1.0 [Re: Gazzbass] #36877
12/03/04 06:04
12/03/04 06:04
Joined: Oct 2004
Posts: 1,856
TheExpert Offline
Senior Developer
TheExpert  Offline
Senior Developer

Joined: Oct 2004
Posts: 1,856
Well , very good.

i have pixel shader V2 on my radeon 9800 Pro , but a lot of people have 3D cards
with 1.4 version, perhaps someone will adapt the code for them ?
a lot of people play Far Cry with shaders V1.4, that's just the engine that have differents versions of code i think.
But because it isn't a package included in official 3DGS download, that's not
perhaps necessary to adapt under V2 version ?

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 Offline
Developer
danthaman015  Offline
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] #36879
12/03/04 07:25
12/03/04 07:25
Joined: Sep 2004
Posts: 1,214
Austin, Texas
Josh_Arldt Offline
Senior Developer
Josh_Arldt  Offline
Senior Developer

Joined: Sep 2004
Posts: 1,214
Austin, Texas
Update the driver for your card.

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 Offline
Serious User
Steempipe  Offline
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 Offline
Senior Developer
Josh_Arldt  Offline
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.

Re: Ulitimate lighting shader pack v1.0 [Re: Josh_Arldt] #36882
12/03/04 08:07
12/03/04 08:07
Joined: Oct 2002
Posts: 815
NY USA
R
Red Ocktober Offline
Developer
Red Ocktober  Offline
Developer
R

Joined: Oct 2002
Posts: 815
NY USA
how are you guys doing performance wise... my moving water is slowing down, just able to notice it, and fraps shows around 14fps ...

--Mike

Page 11 of 24 1 2 9 10 11 12 13 23 24

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1