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
2 registered members (AndrewAMD, Ayumi), 1,395 guests, and 4 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 1 of 2 1 2
Need help with ello's simplegold shader #50992
08/07/05 03:15
08/07/05 03:15
Joined: Aug 2002
Posts: 44
Panama City, FL
S
Specterdragon Offline OP
Newbie
Specterdragon  Offline OP
Newbie
S

Joined: Aug 2002
Posts: 44
Panama City, FL
Hey all (and ello if your listening),

I'm trying to get ello's simplegold shader to function. Sadly, the assembly looses me when I try to use the FX file (or even hardcode it for that matter) I get a string of errors about "uninitialized component(*)"... ok, I've gathered from looking at this that it may need an upgrade from DX8 to DX9 as I've heard there are differences in the ASM code.

Does anyone have a working DX9 version of this shader and or the equivilent shader in HLSL format (which I'd prefer so that I can play with settings and understand better what I'm looking at)? This is a nice simple shader with great impact and I'd love to be able to use it.


Just thinking out loud, Specterdragon
Re: Need help with ello's simplegold shader [Re: Specterdragon] #50993
08/07/05 06:52
08/07/05 06:52
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
post the code.. it shouldnt be hard to convert to hlsl

Re: Need help with ello's simplegold shader [Re: Matt_Aufderheide] #50994
08/07/05 12:23
08/07/05 12:23
Joined: Aug 2002
Posts: 44
Panama City, FL
S
Specterdragon Offline OP
Newbie
Specterdragon  Offline OP
Newbie
S

Joined: Aug 2002
Posts: 44
Panama City, FL
Here is the code I downloaded off of ello's website:

Code:
 
//simple gold
// uses a grey randomnoise texture
//created by ello 2004
//visit www.earthcontrol.de
//its kinda easy to change the material color and shinyness

texture mtlSkin1;
matrix matWorldViewProj;
matrix matWorld;
vector vecViewDir;
vector vecViewPos;
vector vecSunDir;
technique secondset{
pass p0 {
// Cullmode=0;
texture[0]=<mtlSkin1>;
AlphaBlendEnable=1;
BlendOp=1;
VertexShaderConstant[0]=<matWorldViewProj>;
VertexShaderConstant[4]=<matWorld>;
VertexShaderConstant[12]=<vecViewPos>;
VertexShaderConstant[13]=<vecSunDir>;
VertexShaderConstant[14]=<vecViewDir>;
VertexShaderConstant[20]={1,3,2,2};
VertexShader=
decl {
stream 0;
float v0[3];
float v1[3];
float v2[3];
}
asm {
vs.1.1
m4x4 oPos,v0,c0

m3x3 r0,v1,c4
m4x4 oT1,r0,c14
mul oD0,r0,c14
mul r0,r0,c20
mul oT0,v2,r0

};

PixelShaderConstant[0]={0.67,0.58,0.06,1.0}; //gold

PixelShader=
asm {
ps.1.4
texld r0,t0
texcrd r1.xyz,t1.xyz
dp3 r2,r1_bx2,r0 //use r0_bx2 for brighter reflex
add r0,r0,r0
add_sat r3,r0,r2
lrp r0,r2,1-r3,r0
add_x2 r0,r0_bias,v0
dp3 r0.b,r0,r0
mul r0,r0,c0
};
}

}





Just thinking out loud, Specterdragon
Re: Need help with ello's simplegold shader [Re: Specterdragon] #50995
08/08/05 13:57
08/08/05 13:57
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
remove decl{} section and add this in asm {} section:
Code:

vs.1.1
dcl_position v0;
dcl_tangent v1;
dcl_binormal v2;
m4x4 oPos, v0,c0;
.
.
.


May be You need to redefine constants {1,3,2,2} -> {1.0f,3.0f,2.0f,2.0f}
and add Fog calculations if You have it in your game.

Re: Need help with ello's simplegold shader [Re: Lion_Ts] #50996
08/08/05 22:23
08/08/05 22:23
Joined: Aug 2002
Posts: 44
Panama City, FL
S
Specterdragon Offline OP
Newbie
Specterdragon  Offline OP
Newbie
S

Joined: Aug 2002
Posts: 44
Panama City, FL
Tried that already, but for what it's worth, here's the code snippit as it is now from the decl{}

Code:
 
VertexShaderConstant[20]={1.0f,3.0f,2.0f,2.0f};
VertexShader=
decl {
vs.1.1
dcl_position v0;
dcl_tangent v1;
dcl_binormal v2;
m4x4 oPos, v0,c0;
}
asm {
vs.1.1
m4x4 oPos,v0,c0

m3x3 r0,v1,c4
m4x4 oT1,r0,c14
mul oD0,r0,c14
mul r0,r0,c20
mul oT0,v2,r0

};



Still receiving
"error X5326: Read of uninitialized component(*) in v0: *x/0 *y/1 *z/2 *w/3"

And this error repeats for at least 6 more lines with various registers until the error warning window runs out of room.


Just thinking out loud, Specterdragon
Re: Need help with ello's simplegold shader [Re: Specterdragon] #50997
08/08/05 22:56
08/08/05 22:56
Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
Rhuarc Offline
Expert
Rhuarc  Offline
Expert

Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
Like this:
Code:
 
VertexShaderConstant[20]={1.0f,3.0f,2.0f,2.0f};
VertexShader=
asm {
vs.1.1
dcl_position v0;
dcl_tangent v1;
dcl_binormal v2;
m4x4 oPos, v0,c0;

m3x3 r0,v1,c4
m4x4 oT1,r0,c14
mul oD0,r0,c14
mul r0,r0,c20
mul oT0,v2,r0

};



-Rhuarc


I no longer post on these forums, keep in touch with me via:
Linkedin.com
My MSDN blog
Re: Need help with ello's simplegold shader [Re: Rhuarc] #50998
08/09/05 19:01
08/09/05 19:01
Joined: Jul 2002
Posts: 2,813
U.S.
Nadester Offline

Expert
Nadester  Offline

Expert

Joined: Jul 2002
Posts: 2,813
U.S.
Still might not work (though I could be wrong). We were trying to convert another one of his similiar shaders, and me nor him were able to get the DX9 version to work. Was quite strange


--Eric
Re: Need help with ello's simplegold shader [Re: Nadester] #50999
08/10/05 00:32
08/10/05 00:32
Joined: Aug 2002
Posts: 44
Panama City, FL
S
Specterdragon Offline OP
Newbie
Specterdragon  Offline OP
Newbie
S

Joined: Aug 2002
Posts: 44
Panama City, FL
Perhaps...

I've made the sugested changes, but I'm still getting the same error (though not as many now) plus a new error about the lrp command.

Starting to think I may have to learn the ASM and convert it to HLSL unless someone here is ambisious enough to assist me with that?


Just thinking out loud, Specterdragon
Re: Need help with ello's simplegold shader [Re: Specterdragon] #51000
08/10/05 06:44
08/10/05 06:44
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
try:
Code:

//simple gold
// uses a grey randomnoise texture
//created by ello 2004
//visit www.earthcontrol.de
//its kinda easy to change the material color and shinyness

texture mtlSkin1;
matrix matWorldViewProj;
matrix matWorld;
vector vecViewDir;
vector vecViewPos;
vector vecSunDir;
technique secondset{
pass p0 {
texture[0]=<mtlSkin1>;
VertexShaderConstant[0]=<matWorldViewProj>;
VertexShaderConstant[4]=<matWorld>;
VertexShaderConstant[12]=<vecViewPos>;
VertexShaderConstant[13]=<vecSunDir>;
VertexShaderConstant[14]=<vecViewDir>;
VertexShaderConstant[20]={1,3,2,2};
VertexShaderConstant[24]={0.1,0.05,0.01,0.005};
VertexShader=
asm {
vs_1_1
dcl_position v0
dcl_normal v3
dcl_texcoord v7

m4x4 oPos,v0,c0

m3x3 r0,v3,c4
m4x4 oT1,r0.xyz,c14
mul oD0,r0.xyz,c14
mul r0,r0.xyz,c20
mul r1,v7,r0
mul oT0,r1,c24.x

};

PixelShaderConstant[0]={0.67,0.58,0.06,1.0}; //gold

PixelShader=
asm {
ps_1_4
texld r0,t0
texcrd r1.xyz,t1.xyz
dp3 r2,r1,r0 //use r0_bx2 for brighter reflex
add r0,r0,r0
add_sat r3,r0,r2
lrp r0,r2,1-r3,r0
add_x2 r0,r0,v0
dp3 r0.b,r0,r0
mul r0,r0,c0
};
}

}



i made some changes which i dont know why i had to do so, but its at least looking nearly like it should and get you into the right direction.
it hardly depends on a seamless uv_map for your model


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
Re: Need help with ello's simplegold shader [Re: ello] #51001
08/10/05 11:55
08/10/05 11:55
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
Thanks, ELLO !
You find free time to help us. You are good guy. Like a Robin

Page 1 of 2 1 2

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