Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,251 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
terraintex.fx for an unlimited number of terrain textures? #338885
08/22/10 11:55
08/22/10 11:55
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline OP
Senior Expert
Pappenheimer  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Why does it say "Terrain material for an unlimited number of terrain textures"?
This makes no sense!
Code:
//////////////////////////////////////////////////////////////////////
// terraintex.fx
// Terrain material for an unlimited number of terrain textures
// Tiled texture on RGB, mask on alpha 

Texture entSkin1; // basic tiled terrain texture
Texture LightMap; // lightmap created by the map compiler

bool PASS_SOLID; // enforce rendering on the solid pass

bool AUTORELOAD;

//////////////////////////////////////////////////////////////////////

// technique without lightmap
technique terraintex
{
	pass multi_repeat11
	{
    ZWriteEnable = True;
		AlphaBlendEnable = True;
		SrcBlend = SrcAlpha;
    DestBlend = InvSrcAlpha;
		
		Texture[0] = <entSkin1>;
		TexCoordIndex[0] = 0;
		AlphaOp[0] = SelectArg1;
		AlphaArg1[0] = Texture;
		
		Texture[1] = <entSkin1>;
		TexCoordIndex[1] = 1;
    ColorArg1[1] = Texture; 
	  ColorArg2[1]= Diffuse;
	  ColorOp[1] = Modulate2x;
	  AlphaArg1[1] = Current;
	  AlphaOp[1] = SelectArg1;

	  ColorOp[2] = Disable;
	  AlphaOp[2] = Disable;
	}
}

// technique with lightmap
technique terraintex_lm
{
	pass multi_repeat11
	{
      ZWriteEnable = True;
		AlphaBlendEnable = True;
		SrcBlend = SrcAlpha;
      DestBlend = InvSrcAlpha;
		
		Texture[0] = <entSkin1>;
		TexCoordIndex[0] = 0;
		AlphaOp[0] = SelectArg1;
		AlphaArg1[0] = Texture;
		
		Texture[1] = <LightMap>;
		TexCoordIndex[1] = 0;
      ColorArg1[1] = Texture; 
	   ColorArg2[1]= Diffuse;
	   ColorOp[1] = AddSigned;
	   AlphaArg1[1] = Current;
	   AlphaOp[1] = SelectArg1;

		Texture[2] = <entSkin1>;
		TexCoordIndex[2] = 1;
      ColorArg1[2] = Texture; 
	   ColorArg2[2]= Current;
	   ColorOp[2] = Modulate2x;
	   AlphaArg1[2] = Current;
	   AlphaOp[2] = SelectArg1;

	   ColorOp[3] = Disable;
	   AlphaOp[3] = Disable;
	}
}

// fallback if nothing works
technique fallback { pass one { } }



Re: terraintex.fx for an unlimited number of terrain textures? [Re: Pappenheimer] #338887
08/22/10 12:06
08/22/10 12:06
Joined: Apr 2010
Posts: 172
W
wdlmaster Offline
Member
wdlmaster  Offline
Member
W

Joined: Apr 2010
Posts: 172
From the shader section of the manual:
Quote:

Passes can have arbitrary names, with the following exception (A7.60): If the first pass name contains the character sequence "_repeat", the pass is repeated for every skin of the model. After each pass the skins assigned to entSkin1..entSkin3 are incremented by 1. So if the model has 5 skins, the pass is repeated 5 times, with entSkin1 set to the model's first, second, third, fourth, and fifth skin in succession. This special method can be used to render an arbitrary number of skins, for instance for multitexture terrain with 4 or more textures.


Re: terraintex.fx for an unlimited number of terrain textures? [Re: wdlmaster] #338892
08/22/10 12:39
08/22/10 12:39
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline OP
Senior Expert
Pappenheimer  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Ah, okay, and each texture has its own alphachannel with its own informations of its blending. Now I got it. Thank you.

Re: terraintex.fx for an unlimited number of terrain textures? [Re: Pappenheimer] #338928
08/22/10 19:43
08/22/10 19:43
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline OP
Senior Expert
Pappenheimer  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Is there a way to use a different bitmap than the lightmap of the map compiler?

Just in case...

Re: terraintex.fx for an unlimited number of terrain textures? [Re: Pappenheimer] #338982
08/23/10 13:52
08/23/10 13:52
Joined: Apr 2010
Posts: 172
W
wdlmaster Offline
Member
wdlmaster  Offline
Member
W

Joined: Apr 2010
Posts: 172
replace the "lightmap" texture with another bitmap. You must define a BMAP* and use the same name + _bmap in the shader code. Example:

in the script:
Code:
BMAP* lightmap123 = "lightmap123.tga";


in the shader:
Code:
texture lightmap123_bmap;
...
...
texture[1] = <lightmap123_bmap>;
...
...



Re: terraintex.fx for an unlimited number of terrain textures? [Re: wdlmaster] #338991
08/23/10 16:15
08/23/10 16:15
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline OP
Senior Expert
Pappenheimer  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
That's great. Thank you!

How can I use terraintex.fx for models? [Re: Pappenheimer] #340425
09/04/10 03:11
09/04/10 03:11
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline OP
Senior Expert
Pappenheimer  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Used for a model, the shader seems to show the textures by their alpha channels as well, but I miss something like detail_size.
At the moment the textures are huge and blurry.
Can't find something like detail_size in the manual.

Re: How can I use terraintex.fx? [Re: Pappenheimer] #341599
09/18/10 13:59
09/18/10 13:59
Joined: Nov 2004
Posts: 85
Deutschland, NRW, Eschweiler
A
annonymie Offline
Junior Member
annonymie  Offline
Junior Member
A

Joined: Nov 2004
Posts: 85
Deutschland, NRW, Eschweiler
Hello, I also have a problem with that Shader.

I created a terrain with a skin (DDS with complete white Alpha channel). I only need a terrain with a grass texture. Without the shader it's too diffuse.

Are there any tutorials? I've already read the infos in the manual.


A8.30.5 Commercial
Re: How can I use terraintex.fx? [Re: annonymie] #341602
09/18/10 14:36
09/18/10 14:36
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Nidhogg Offline
Serious User
Nidhogg  Offline
Serious User

Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Originally Posted By: annonymie
Hello, I also have a problem with that Shader.

I created a terrain with a skin (DDS with complete white Alpha channel). I only need a terrain with a grass texture. Without the shader it's too diffuse.

Are there any tutorials? I've already read the infos in the manual.


Yes please a tutorial would be great. I too have problems with this shader.


Windows XP SP3
Intel Dual Core CPU: E5200 @ 2.5GHz
4.00GB DDR3 Ram
ASUS P5G41T-M LX
PCIE x16 GeForce GTS 450 1Gb
SB Audigy 4
Spyware Doctor with AntiVirus
Re: How can I use terraintex.fx? [Re: Nidhogg] #341611
09/18/10 16:47
09/18/10 16:47
Joined: Apr 2010
Posts: 172
W
wdlmaster Offline
Member
wdlmaster  Offline
Member
W

Joined: Apr 2010
Posts: 172
Quote:

...but I miss something like detail_size...

You must set detail_size before loading the terrain
Quote:

I only need a terrain with a grass texture. Without the shader it's too diffuse.

If you only use ONE texture, you don't need that shader at all.
Quote:

Yes please a tutorial would be great. I too have problems with this shader.

What kind of problems? If you mean the detail_size, set it BEFORE the terrain is loaded. If you mean the blending of the textures, look in the manual.

But i would not recommend this shader anyway, because it's very ineffective. Every texture is rendered in a seperate pass!

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