1 registered members (AndrewAMD),
1,248
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Sehr gute Shader-Seite / Very good shader site
#204311
04/28/08 17:14
04/28/08 17:14
|
Joined: Apr 2007
Posts: 141 Germany
Timothy
OP
Member
|
OP
Member
Joined: Apr 2007
Posts: 141
Germany
|
Hallo, Ich bin im Web auf folgende Seite gestoßen: http://www.zanir.szm.sk/dx10-19.htmlDort sind (meiner Meinung nach) sehr gute Shader für das Shadermodell 1.1 Beispiele: Parallax, Dynamical Cube Mapping und Motion Blur. Ich kenne mich nicht besonders gut mit Shadern aus, aber ich glaube nicht, dass sie in HLSL geschrieben sind. Trotzdem lohnt sich ein Blick darauf. // Hello, I found this site in the WWW: http://www.zanir.szm.sk/dx10-19.htmlThere are some very good model 1.1 shaders (after my opinion). Examples: Parallax, Dynamical Cube Mapping and Motion Blur. I don't know much about shaders, but I think they are not written in HLSL. But give it a try. Greetings
|
|
|
Re: Sehr gute Shader-Seite / Very good shader site
[Re: Timothy]
#204315
04/28/08 17:37
04/28/08 17:37
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
Thanks for this great Link! vs.1.0 // version instruction
// c0-c3 contains composite transform matrix
m4x4 oPos, v0, c0 // transform vertices by view/projection matrix
// v2 texture coordination
mov oT0.xy, v2
mov oT1.xy, v2
// c4 lpos
// c6 eye
// H = HalfVector = Normalize( VertexToEyeVector + LightVector )
add r0, c4, -v0 // L = lpos - vertex, L in object space
add r1, c6, -v0 // VertexToEyeVector
add r0, r0, r1 // HalfVector
// v3 Tangent, x
// v4 Binormal, y
// v1 normal, z
// matrix for object space to surface space
// ( Tan.x Tan.y Tan.z ) = ( v3.x v3.y v3.z ) ( L.x )
// ( Bin.x Bin.y Bin.z ) = ( v4.x v4.y v4.z ) * ( L.y )
// ( nor.x nor.y nor.z ) = ( v1.x v1.y v1.z ) ( L.z )
dp3 r1.x, v3, r0
dp3 r1.y, v4, r0
dp3 r1.z, v1, r0
// r1 H vector in texture space
// normalize vector in r1
dp3 r1.w, r1, r1 // r1.w = |r1|^2
rsq r1.w, r1.w // r1.w = 1/sqrt(r0.w) = 1/|r1|
mul r1.xyz, r1, r1.w // r1 - normalized L vector in texture space
// <-1, 1> to <0,1>
// c5 0.5, 0.5, 0.5, 0.5
mad oD0, r1, c5, c5
This doesn't look like it is gamestudio compatible... Does anybody now how to convert these shaders? Dark_Samurai
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: Sehr gute Shader-Seite / Very good shader site
[Re: Scorpion]
#204321
04/28/08 17:56
04/28/08 17:56
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
I've never saw any asm code ^^ Can you convert this shader as example for me, so that I can convert the rest my selve, please? Dark_Samurai
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: Sehr gute Shader-Seite / Very good shader site
[Re: Dark_samurai]
#204325
04/28/08 18:31
04/28/08 18:31
|
Joined: Apr 2007
Posts: 141 Germany
Timothy
OP
Member
|
OP
Member
Joined: Apr 2007
Posts: 141
Germany
|
I looked up asm in the manual. It should work in the engine. Example: material test { effect = " asm { vs.1.0 // version instruction m4x4 oPos, v0, c0 // transform vertices by view/projection matrix // v0 - pozicia vrchola // v1 - normalovy vektor // c0-c3 contains composite transform matrix // c6 pozicia kamery v suradniciach objektu // c7 -2,-2,-2,-2 // inline vec ReflectedRay( const vec &in, const vec &n) // in from eye to vertex // return (in - 2.f*n*DOT3( in, n)); add r0, v0, -c6 // r0 = in = vertex - eye // normalize vector in r0 dp3 r0.w, r0, r0 // r0.w = |r0|^2 rsq r0.w, r0.w // r0.w = 1/sqrt(r0.w) = 1/|r0| mul r0.xyz, r0, r0.w // r0 - normalized in vector // DOT3( in, n) dp3 r1, r0, v1 // r0 = in, v1 = n // n*DOT3( in, n) mul r1, r1, v1 // v1 = n // in - 2.f*n*DOT3( in, n) = f = r1 mad oT0.xyz, r1, c7, r0 // r1 = r1*c7+r0 //... } "; } Just a suggestion. I'm a shadernoob . That should be cube mapping Look it up in the manual, just type in asm.
|
|
|
Re: Sehr gute Shader-Seite / Very good shader site
[Re: Timothy]
#204894
05/02/08 10:06
05/02/08 10:06
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
Ok this is what I got so far (specular normalmapping): technique NormalSpec
{
pass P0
{
VertexShader =
asm
{
vs_1_1 // version instruction
// c0-c3 contains composite transform matrix
m4x4 oPos, v0, c0 // transform vertices by view/projection matrix
// v2 texture coordination
mov oT0.xy, v2
mov oT1.xy, v2
// c4 lpos
// c6 eye
// H = HalfVector = Normalize( VertexToEyeVector + LightVector )
add r0, c4, -v0 // L = lpos - vertex, L in object space
add r1, c6, -v0 // VertexToEyeVector
add r0, r0, r1 // HalfVector
// v3 Tangent, x
// v4 Binormal, y
// v1 normal, z
// matrix for object space to surface space
// ( Tan.x Tan.y Tan.z ) = ( v3.x v3.y v3.z ) ( L.x )
// ( Bin.x Bin.y Bin.z ) = ( v4.x v4.y v4.z ) * ( L.y )
// ( nor.x nor.y nor.z ) = ( v1.x v1.y v1.z ) ( L.z )
dp3 r1.x, v3, r0
dp3 r1.y, v4, r0
dp3 r1.z, v1, r0
// r1 H vector in texture space
// normalize vector in r1
dp3 r1.w, r1, r1 // r1.w = |r1|^2
rsq r1.w, r1.w // r1.w = 1/sqrt(r0.w) = 1/|r1|
mul r1.xyz, r1, r1.w // r1 - normalized L vector in texture space
// <-1, 1> to <0,1>
// c5 0.5, 0.5, 0.5, 0.5
mad oD0, r1, c5, c5
};
}
} There are a lot of errors like this one: "(13): error X5326: Read of uninitialized components(*) in v2: *x/0 *</1 z/2 w/3". What am I doing wrong? Thanks!
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: Sehr gute Shader-Seite / Very good shader site
[Re: Dark_samurai]
#204896
05/02/08 10:50
05/02/08 10:50
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
Thanks for the salutary site Timothy Although, most of the effects on that site that I've seen on there are written in asm and since asm is a 'harder' to grasp than HLSL, I would advice not to start learning asm but HLSL Cheers Frazzle
Antec® Case Intel® X58 Chipset Intel® i7 975 Quad Core 8 GB RAM DDR3 SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB NVIDIA® GeForce GTX 295 Memory 1795GB
|
|
|
Re: Sehr gute Shader-Seite / Very good shader site
[Re: frazzle]
#204904
05/02/08 11:47
05/02/08 11:47
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
I don't want to learn asm, I only want to get these shaders working in GS...
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
|