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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,089 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 7 of 8 1 2 3 4 5 6 7 8
Re: Check This Out - Parallax Mapping [Re: M3PHiSTOPH3L3S] #34811
12/11/04 18:37
12/11/04 18:37
Joined: May 2002
Posts: 2,541
Berlin
EX Citer Offline
Expert
EX Citer  Offline
Expert

Joined: May 2002
Posts: 2,541
Berlin
Hi,
The screenshots look like the code is finished. I would need it for one model. I think the shader runs very slow on leveltextures (in a complete level). On which ps and vs version is the shader running? I hope itīs not using any entity skills.

EX Citer


:L
Re: Check This Out - Parallax Mapping [Re: EX Citer] #34812
12/12/04 07:41
12/12/04 07:41
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
The last screenshot is using pixelshader 2.0.

There are no entity skills in the code.

It is pretty much done. However... I have not worked with it since the screenshot, and I am also waiting for some results from a user who is testing it.

Re: Check This Out - Parallax Mapping [Re: Steempipe] #34813
12/13/04 06:09
12/13/04 06:09
Joined: Oct 2004
Posts: 1,856
TheExpert Offline
Senior Developer
TheExpert  Offline
Senior Developer

Joined: Oct 2004
Posts: 1,856
it would be cool to make it less specular , we have a lot of reflection like
effect on the last picture for the wood material.

Re: Check This Out - Parallax Mapping [Re: TheExpert] #34814
12/27/04 07:37
12/27/04 07:37
Joined: May 2002
Posts: 2,541
Berlin
EX Citer Offline
Expert
EX Citer  Offline
Expert

Joined: May 2002
Posts: 2,541
Berlin
Does it really exists? Or is it a mythos?

What about the last versions? I couldnīt see any bugs.


:L
Re: Check This Out - Parallax Mapping [Re: EX Citer] #34815
12/27/04 08:28
12/27/04 08:28
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
Yeah, is this thing still in development? I'm curious for the code, though I can't try it out where I am right now, so *don't* hurry hehehehe..

Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: Check This Out - Parallax Mapping [Re: EX Citer] #34816
12/27/04 08:31
12/27/04 08:31
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:

Does it really exists? Or is it a mythos?

What about the last versions? I couldnīt see any bugs.




Just for you... Merry Xmas (belated)

Code:

// -------------------------------------------------------------
// Parallax (offset) Mapping Shader for 3DGS Model Entities
//
// By: Eric Hendrickson-Lambert (Steempipe)
//
// Requires: A6.31+, DX9.00c, and pixelshader.2.0
//
//
// Note: As always, this is a work in progress....
// To be free for use; credit appreciated.
//

// 11/17/04: -Cleaned up code for release
// 11/27/04: -Modified the code to follow suit
// with Matt A's Ultimate Lighting Shader.
// For easier integration and modification.
// 11/28/04 -(2) dynamic lights added.
//
//
// ToDo: -Add more light passes
// -Iron out the view vectors in the effect
// -Add another texture for use as gloss/spec mask
-Spit out gloss/spec UV with seperate coords for individual scaling
//
// Collaborators: -Drew Medina (Testing, bug reporting, and demo work)
//
// -------------------------------------------------------------


material mat_parallax {

flags=tangent;

effect="

float4x4 matWorldViewProj;
float4x4 matWorld;
float4x4 matViewInv;

float3x3 WldToTan;

float4 vecViewPos;
float4 vecViewDir;

float4 vecLight;
float4 vecLightPos[8];
float4 vecLightColor[8];

texture entSkin1;
texture entSkin2;
texture entSkin3;

sampler sColorMap = sampler_state
{
Texture = <entSkin1>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = Wrap;
AddressV = Wrap;
};


sampler sBumpMap = sampler_state
{
Texture = <entSkin2>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = Wrap;
AddressV = Wrap;
};


sampler sHeightMap = sampler_state
{
Texture = <entSkin3>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = Wrap;
AddressV = Wrap;
};



struct VS_OUTPUT
{
float4 oPosition : POSITION;
float2 Tex : TEXCOORD0;
float3 Light1 : TEXCOORD2;
float3 View1 : TEXCOORD3;
float3 Att1 : TEXCOORD4;

float3 Light2 : TEXCOORD5;
float3 View2 : TEXCOORD6;
float3 Att2 : TEXCOORD7;
};


VS_OUTPUT main_vs(float4 inPosition : POSITION, float2 inTex : TEXCOORD0, float3 inNormal : NORMAL, float3 inTangent : TEXCOORD2 )
{
VS_OUTPUT Out ;

Out.oPosition = mul(inPosition, matWorldViewProj);

WldToTan[0] = mul(inTangent, matWorld);
WldToTan[1] = mul(cross(inTangent, inNormal), matWorld);
WldToTan[2] = mul(inNormal, matWorld);

Out.Tex = inTex.xy * 1.5; //Scale the texture UV's


float4 Pos_World = mul( inPosition, matWorld);

float LightRange1 = 0.003;
float LightRange2 = 0.005;

//light 1
float3 Light1 = Pos_World - vecLightPos[1];
Out.Light1.xyz = mul(WldToTan, -Light1);

float3 Viewer1 = Pos_World - vecViewDir;
Out.View1.xzy = mul(WldToTan, -Viewer1);

Out.Att1 = Light1 * LightRange1;
//light 2
float3 Light2 = Pos_World - vecLightPos[2];
Out.Light2.xyz = mul(WldToTan, -Light2);

float3 Viewer2 = Pos_World - vecViewDir;
Out.View2.xzy = mul(WldToTan, -Viewer2);

Out.Att2 = Light2 * LightRange2;

return Out;
}

struct PS_INPUT0
{
float2 Tex : TEXCOORD0;
float3 Light1 : TEXCOORD2;
float3 View1 : TEXCOORD3;
float3 Att1 : TEXCOORD4;
float3 Light2 : TEXCOORD5;
float3 View2 : TEXCOORD6;
float3 Att2 : TEXCOORD7;

};

float4 main_ps(PS_INPUT0 IN): COLOR
{
const float HeightScale = {0.030000f};
const float BiasFilter = {0.025000f};



float3 ViewDir = normalize(IN.View1);
float4 color;
float3 bumpNormal;

float Height = HeightScale * tex2D(sHeightMap, IN.Tex) - BiasFilter;
float2 OffsetTex = Height * ViewDir + IN.Tex;
color = tex2D(sColorMap, OffsetTex);
bumpNormal =(2 * (tex2D(sBumpMap, OffsetTex )))- 1.0;
float4 gloss = tex2D( sBumpMap, OffsetTex);

//light1
float3 LightDir1 = normalize(IN.Light1);
float3 ViewDir1 = normalize(IN.View1);
float4 diff1 = saturate(dot(bumpNormal, LightDir1));
float shadow1 = saturate(2 * diff1);
float3 Reflect1 = normalize(2 * diff1 * bumpNormal - LightDir1);
float4 spec1 = pow(saturate(dot(Reflect1, ViewDir1)), 8);
float4 Attenuation1 = saturate(dot(IN.Att1, IN.Att1));

//light2
float3 LightDir2 = normalize(IN.Light2);
float3 ViewDir2 = normalize(IN.View2);
float4 diff2 = saturate(dot(bumpNormal, LightDir2));
float shadow2 = saturate(2 * diff2);
float3 Reflect2 = normalize(2 * diff2 * bumpNormal - LightDir2);
float4 spec2 = pow(saturate(dot(Reflect2,ViewDir2)), 8);
float4 Attenuation2 = saturate(dot(IN.Att2, IN.Att2));

return (
(0.2 * color) + //ambient
((shadow1 * (color * diff1 + (spec1)) * (1 -Attenuation1))*vecLightColor[1])+
((shadow2 * (color * diff2 + (spec2)) * (1 -Attenuation2))*vecLightColor[2])
);

//return (0.2 * color + color* diff1 * vecLightColor[1]+diff2 * vecLightColor[2]);

}



technique Parallax
{
pass P0
{

VertexShader = compile vs_2_0 main_vs();
PixelShader = compile ps_2_0 main_ps();
}
}


";
}

action parallax_fx{

my.material = mat_parallax;
//my.frame+=1; //If engine tangent bug is not rectified yet


}


}






Re: Check This Out - Parallax Mapping [Re: Steempipe] #34817
12/27/04 08:43
12/27/04 08:43
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
Oh yah..... here are what the (3) skins look like.



Re: Check This Out - Parallax Mapping [Re: Steempipe] #34818
12/27/04 09:14
12/27/04 09:14
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
LOL!! Damn and now I have to wait quite some time before I can try this shader.... Aaaaarrrrrgghh!! BUT very much appreciated anyways hehehe, you're playing your role as santa very good (belated) ..

Cheerrs!


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: Check This Out - Parallax Mapping [Re: PHeMoX] #34819
12/27/04 09:29
12/27/04 09:29
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
This is freakin' awsome!!!

Quote:

you're playing your role as santa very good




You should change your name to Santapipe or something.j/k.

This sort of thing is done in the AMP II Engine,
but doesn't require a good video card to see the fx.
Are the AMP II shaders FFP shaders or something?

Last edited by HSB; 12/27/04 09:37.
Re: Check This Out - Parallax Mapping [Re: Josh_Arldt] #34820
12/27/04 13:27
12/27/04 13:27
Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
Drew Offline
Serious User
Drew  Offline
Serious User

Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
Steempipie-
Just tried again, the warping was because i wasnt putting my heightmap in skin3, it was in my alpha chsannel.
That gave me alpha problems, so i tried without...looked good but warped, then added the skin3, LOOKS FANTASTIC.

Thanks


Drew Medina
Game Developer (Artist)
Personal & professional website
Deviant Art
My Blogspot
Page 7 of 8 1 2 3 4 5 6 7 8

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