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
0 registered members (), 781 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 5 1 2 3 4 5
Re: Multitex Terrain Normalmapping [Re: mireazma] #369076
05/01/11 12:58
05/01/11 12:58
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
You can have only 4 entity skins and 4 material skins available in a shader. Since your problem concerns only terrains, you could access the blendmap over a static bitmap (every BMAP* can be access in a shader, if the name is known, e.g. BMAP* myBitmap; is accessible in a shader via texture myBitmap_bmap;), so you could use 4 entity skins for the textures and 4 material skins for the normal maps. Since each texture has 4 channels, you have virtually (4+4)*4 = 32 channels, which would allow 6 RGB textures with their respective normal map in XY format (Z component can be restored). A special application is therefore needed to encode these 6 textures + 6 normal maps into a total of 8 RGBA images.

An alternative would be use -only- static bitmaps like

Code:
BMAP *terrainTexBase, *terrainTexBaseNm;
BMAP *terrainTex1, *terrainTex1Nm;
BMAP *terrainTex2, *terrainTex2Nm;
BMAP *terrainTex3, *terrainTex3Nm;
BMAP *terrainTex4, *terrainTex4Nm;
BMAP *terrainTex5, *terrainTex5Nm;
BMAP *terrainTex6, *terrainTex6Nm;
...



But this requires a manually loading of textures into those bitmaps.

To modify the terrain shader posted above to use 4 instead of 3 textures, while the channels are stored in base, red and green textures, you have to compose the blueColor by their alpha values:

Code:
float4 blueColor = float4(baseColor.a, redColor.a, greenColor.a, 0);



Exactly the same procedure for the normal.

Then you have to adjust the lerp's, so that you use ONLY the .rgb components of the colors and normals, so that you DON'T accidently mix something strange by using the alpha value of the colors which store a channel of the blue color / normal.

The lightmap is stored currently in the blue channel of the blendmap, you would then have to adjust it to the alpha channel then:

Code:
float  shadow = mask.a;



and, of course, use the blue channel value as weight for the color/normal of the blue texture.

Last edited by HeelX; 05/01/11 12:59.
Re: Multitex Terrain Normalmapping [Re: HeelX] #369098
05/01/11 16:07
05/01/11 16:07
Joined: Feb 2010
Posts: 68
mireazma Offline
Junior Member
mireazma  Offline
Junior Member

Joined: Feb 2010
Posts: 68
Well, it looks too entangled for me at the first sight but I saved the web page for offline analysis and made it a priority task.
Quote:
A special application is therefore needed to encode these 6 textures + 6 normal maps into a total of 8 RGBA images.

You mean like Photoshop?

About the static bitmaps approach:
What would the downside of using this be (besides manual loading)? slow performance?
And this sounds like the dumbest conclusion I could draw: it would allow virtually unlimited no. of textures, right?

And I almost forgot: tell me if there's a way to use this shader as it is now, with parallax or displacement? As a matter of fact, I got here starting precisely with the terrain parallax or displacement in mind. Please.


ERROR in communism.cpp, line 0:
#include<god.h>
was fatally missed.
Re: Multitex Terrain Normalmapping [Re: mireazma] #369121
05/01/11 20:08
05/01/11 20:08
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
This shader only allows normalmapping, parallax/displacement mapping is not supported. And Yes, theoretically, you could have unlimited textures for such a terrain shader.

I didn't meant Photoshop, though, you can do this by hand with it, too. An application I had in mind just takes in the filenames of 4 textures and their corresponding normalmaps -- and ensembles the encoded RGBA images. Like a console application or so. This way, you can simply press a button - and voila! - you have it.

Re: Multitex Terrain Normalmapping [Re: HeelX] #369313
05/03/11 14:15
05/03/11 14:15
Joined: Feb 2010
Posts: 68
mireazma Offline
Junior Member
mireazma  Offline
Junior Member

Joined: Feb 2010
Posts: 68
Thanks again.


ERROR in communism.cpp, line 0:
#include<god.h>
was fatally missed.
Re: Multitex Terrain Normalmapping [Re: mireazma] #372596
06/02/11 21:29
06/02/11 21:29
Joined: May 2008
Posts: 257
D
djfeeler Offline
Member
djfeeler  Offline
Member
D

Joined: May 2008
Posts: 257
The link est dead. could you re upload please ?

Re: Multitex Terrain Normalmapping [Re: djfeeler] #372618
06/03/11 07:39
06/03/11 07:39
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline OP
Expert
fogman  Offline OP
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany


no science involved
Re: Multitex Terrain Normalmapping [Re: fogman] #372626
06/03/11 09:09
06/03/11 09:09
Joined: May 2008
Posts: 257
D
djfeeler Offline
Member
djfeeler  Offline
Member
D

Joined: May 2008
Posts: 257
Thanks

Re: Multitex Terrain Normalmapping [Re: djfeeler] #377526
07/13/11 22:59
07/13/11 22:59

M
Malice
Unregistered
Malice
Unregistered
M



When using this shader the terrain gets heavy fog. How do I stop that or at least less it?


EDIT* Found it by reading a German post(Thanks Google).

You have to comment out this line in the shader
//color = lerp(color, fogColor, fogDensity);

Last edited by Malice; 07/14/11 02:43.
Re: Multitex Terrain Normalmapping [Re: xxxxxxx] #401511
05/21/12 08:18
05/21/12 08:18
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Is there a way to turn the fog off? Even if I have no fog enabled I see a white dust everywhere.

Re: Multitex Terrain Normalmapping [Re: PadMalcom] #401553
05/21/12 15:20
05/21/12 15:20
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
You are doing something probably wrong, cause it works great without fog:

Some kind of workaround, I just edited three lines in main function:
Code:
fog_color = 4;
camera.fog_start = 0;
camera.fog_end   = 50000;





Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Page 3 of 5 1 2 3 4 5

Moderated by  adoado, checkbutton, mk_1, Perro 

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