Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Trading Journey
by 7th_zorro. 04/27/24 04:42
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, Ayumi), 773 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 4
Page 4 of 11 1 2 3 4 5 6 10 11
Re: terrain multitexturing shader [Re: Darkstorm] #17325
01/22/04 04:38
01/22/04 04:38
Joined: Jul 2002
Posts: 156
Thüringen
SFMAT4 Offline
Member
SFMAT4  Offline
Member

Joined: Jul 2002
Posts: 156
Thüringen
Hallo,

ich habe den Shader mit den Detailmap Änderungen versehen. Allerdings wird angezeigt, dass das meine Hardware nicht unterstützt.
Habe ich etwas falsch gemacht oder kann ich diesen Effekt nicht auf einer Geforce 4 Ti 4200 nutzen?

Vielen Dank für die Hilfe!

MfG
SF

Code:
  

material mat_terrain_multitexture
{
effect=
"
texture entSkin1;
texture entSkin2;
texture entSkin3;
texture entSkin4;

matrix matWorldViewProj;
matrix matWorld;
matrix matWorldView;

vector vecSunDir;
vector vecDiffuse;
vector vecAmbient;
vector vecLight;
vector vecFog;
vector vecSkill41;

technique multitexture
{
pass p
{
texture[0]=<entSkin1>;
texture[1]=<entSkin2>;
texture[2]=<entSkin3>;
Texture[3]=<entSkin4>;

magFilter[2]=linear;
minFilter[2]=linear;
mipFilter[2]=linear;

zWriteEnable=true;

vertexShaderConstant[0]=<matWorldViewProj>;
vertexShaderConstant[4]=<matWorld>;
vertexShaderConstant[8]=<matWorldView>;

vertexShaderConstant[16]=<vecSunDir>;
vertexShaderConstant[17]=<vecDiffuse>;
vertexShaderConstant[18]=<vecAmbient>;
vertexShaderConstant[19]=<vecLight>;
vertexShaderConstant[20]=<vecFog>;

vertexShaderConstant[64]=<vecSkill41>; //(u_scale1, v_scale1, u_scale2, v_scale2)
VertexShaderConstant[65]=(1.0f,1.0f,0.0f,0.0f); // specifies the tiling of the detail map
vertexShaderConstant[95]=(0.0f,0.0f,0.0f,0.0f);

vertexShader=
decl
{
stream 0;
float v0[3]; //position
float v3[3]; //normal
float v7[2]; //uv
}
asm
{
vs.1.1
m4x4 oPos,v0,c0 // transform position to clip space

mul oT0.xy,v7.xy,c64.xy // output scaled uvs - stage 0
mul oT1.xy,v7.xy,c64.zw // output scaled uvs - stage 1
mov oT2.xy,v7.xy // output uvs - stage 2
mul oT3.xy,v7.xy,c65.xy // output scaled uvs for the detailmap

m3x3 r0,v3,c4 // transform normal to world space
dp3 r0.w,r0,r0 // renormalize it
rsq r0.w,r0.w
mul r0,r0,r0.w

dp3 r0,r0,-c16 // normal.light -> lighting constant
mul r0.xyz,r0,c17 // modulate against material diffuse color
add oD0.xyz,r0,c19 // add environment light

mov r1.w,c20.w // r1.w=1
dp4 r0,v0,c10 // distance to camera position
add r0,r0,-c20.x // distance-fog_start
mad r0.x,-r0.x,c20.z,r1.w // 1-(distance-fog_start)*(1/(fog_end-fog_start))
max oFog.x,r0.x,c95.w // clamp with custom max value
};
pixelShader=
asm
{
ps.1.3
def c0,1,1,1,1
tex t0 // sample colormap1
tex t1 // sample colormap2
tex t2 // sample macromap
tex t3 // sample detailmap
lrp r0.rgb,t2.a,t0,r1 // blend t0 with t1 using the alpha channel of t2
+mov r0.a,c0
//add r0.rgb,r0,t2_bias // add(signed) rgb of t2
mul r0.rgb,r0,t3_bias // add(signed) rgb of t3 (detailmap)
mul r0.rgb,r0,v0 // modulate with diffuse vertex lighting
};
}
}
";
}





www.easyparticle.com Das Leben ist ein scheiß Spiel. Aber die Grafik ist verdammt Geil!
Re: terrain multitexturing shader [Re: SFMAT4] #17326
01/22/04 07:00
01/22/04 07:00
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
mul r0.rgb,r0,t3_bias

versuch mal bei mul das _bias wegzulassen:

mul r0.rgb,r0,t3

und verwende einen leeren fallback:

technique fallback { pass p0 { } }

auf meiner geforce4 ti4200 funktionieren die meisten shader nicht wenn keine leere fallbacks hinzufüge! sehr seltsam...

Re: terrain multitexturing shader [Re: ventilator] #17327
01/26/04 03:10
01/26/04 03:10
Joined: Jul 2002
Posts: 156
Thüringen
SFMAT4 Offline
Member
SFMAT4  Offline
Member

Joined: Jul 2002
Posts: 156
Thüringen
Hallo,

so langsam wirds mir peinlich

Ich habe deine Änderungen eingefügt. Allerdings kommt entweder eine Fehlermeldung wenn ich den leeren fallback um den Shader lege, oder es wird kein Multytexturing angezeigt wenn ich die Zeile nur über den Shader schreibe.
Warscheinlich habe ich nur irgendwas falsch verstanden. Aber ich befasse mich erst seit kurzen mit Shader effekten. Ich bitte meine "dumme" Frage daher zu entschuldigen
Danke für eure GEdult.

MfG
SF

Code:
 
technique fallback { pass p0 { } }
technique multitexture
{
pass p
{
.
.
.



Code:
 
technique fallback { pass p0 {
technique multitexture
{
pass p
{
.
.
.
} }




www.easyparticle.com Das Leben ist ein scheiß Spiel. Aber die Grafik ist verdammt Geil!
Re: terrain multitexturing shader [Re: SFMAT4] #17328
01/26/04 05:15
01/26/04 05:15
Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
Rhuarc Offline
Expert
Rhuarc  Offline
Expert

Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
Any screenshots for the Pixelshader support impaired?


I no longer post on these forums, keep in touch with me via:
Linkedin.com
My MSDN blog
Re: terrain multitexturing shader [Re: Rhuarc] #17329
01/26/04 09:29
01/26/04 09:29
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
I am working on learning the shaders. But have a couple of small shots here:
http://steempipe.technicalfoundry.com/terrainshots.html

This is using Vent's stock multitexture shader.

Just some one-offs for comparison. The shader is using (1) Grass Tex, (1) Dirt Tex, and (1) alphamap for blending.

Small pics, and not *very* exciting, yet.

Re: terrain multitexturing shader [Re: SFMAT4] #17330
01/26/04 10:29
01/26/04 10:29
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
die fallback technique muss hinter der multitexture technique stehen!

Re: terrain multitexturing shader [Re: ventilator] #17331
01/27/04 01:09
01/27/04 01:09
Joined: Jun 2001
Posts: 2,006
USA
Darkstorm Offline
Senior Expert
Darkstorm  Offline
Senior Expert

Joined: Jun 2001
Posts: 2,006
USA
Hey-

Not to cross post but I thought I might get the shader gurus attention more easily in here . I am having a few glitches with the shading of the terrain when using this shader. Any ideas/help would be appreciated. You can check out some shots snd more info here:

http://www.conitecserver.com/ubbthreads/showflat.php?Cat=&Number=339498&page=0&view=collapsed&sb=5&o=&fpart=1

Thanks.

Re: terrain multitexturing shader [Re: Darkstorm] #17332
01/27/04 01:14
01/27/04 01:14
Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
Rhuarc Offline
Expert
Rhuarc  Offline
Expert

Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
Shots look cool, can't wait to buy my new video card


I no longer post on these forums, keep in touch with me via:
Linkedin.com
My MSDN blog
Re: terrain multitexturing shader [Re: ello] #17333
01/27/04 13:01
01/27/04 13:01
Joined: Feb 2003
Posts: 195
slacker Offline
Member
slacker  Offline
Member

Joined: Feb 2003
Posts: 195
Trying to sort this out - I got that you have two tiled textures, and the shader blends between them based on an alpha channel that is not tiled. cool btw..

(what exactly is a detail map, is it overlayed on your tiled mipmap?}

Is it possible to have a map as a lightmap to do shadows (not tiled)??

thx.

Re: terrain multitexturing shader [Re: slacker] #17334
01/27/04 13:41
01/27/04 13:41
Joined: Jun 2001
Posts: 2,006
USA
Darkstorm Offline
Senior Expert
Darkstorm  Offline
Senior Expert

Joined: Jun 2001
Posts: 2,006
USA
Does this shader set light direction or affect the way that the terrain is shaded? I have been having some strange results (see previous post for link).

Page 4 of 11 1 2 3 4 5 6 10 11

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