Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, ChrstphFr), 864 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 5 1 2 3 4 5
Re: Multitex Terrain Normalmapping [Re: 3run] #401556
05/21/12 16:14
05/21/12 16:14
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
That does not turn off fog...

Re: Multitex Terrain Normalmapping [Re: Rei_Ayanami] #401559
05/21/12 16:44
05/21/12 16:44
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Am I saying that I've turned fog off? I've just set fog_far to default clip_far value. So thats some kind of workaround.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Multitex Terrain Normalmapping [Re: 3run] #414088
12/22/12 17:47
12/22/12 17:47
Joined: Nov 2012
Posts: 32
T
thorus Offline
Newbie
thorus  Offline
Newbie
T

Joined: Nov 2012
Posts: 32
hey guys how can i scale the texture ? couse i wanna have every tile smaller for better graphic, i hope u know what i mean, i mean i need the scale of the pictures.. thanks

Re: Multitex Terrain Normalmapping [Re: thorus] #427542
08/09/13 09:45
08/09/13 09:45
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
I tried to use the shader that way:
Code:
ENTITY* entTerrain = ent_create("dummy.hmp", nullvector, NULL);
	
	BMAP* bmapMask = bmap_create("test_proc_terrain\\earth2_mask.dds");
	BMAP* bmapGrass = bmap_create("test_proc_terrain\\earth2_grass.dds");
	BMAP* bmapRock = bmap_create("test_proc_terrain\\earth2_rock.dds");
	BMAP* bmapSand = bmap_create("test_proc_terrain\\earth2_sand.dds");
	BMAP* bmapGrassNM = bmap_create("test_proc_terrain\\earth2_grass_nm.dds");
	BMAP* bmapRockNM = bmap_create("test_proc_terrain\\earth2_rock_nm.dds");
	BMAP* bmapSandNM = bmap_create("test_proc_terrain\\earth2_sand_nm.dds");
	
	ent_setskin(entTerrain, bmapMask, 1);
	ent_setskin(entTerrain, bmapGrass, 2);
	ent_setskin(entTerrain, bmapRock, 3);
	ent_setskin(entTerrain, bmapSand, 4);
	ent_setskin(entTerrain, bmapGrassNM, 5);
	ent_setskin(entTerrain, bmapRockNM, 6);
	ent_setskin(entTerrain, bmapSandNM, 7);		
	
	// Enable HeelX terrain shader
	init_modelTex3Nm(entTerrain);


But my terrain remains white. Any idea why? The skins use exactly the same images as the demo.

Re: Multitex Terrain Normalmapping [Re: PadMalcom] #427580
08/09/13 20:07
08/09/13 20:07
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Originally Posted By: PadMalcom
Is there a way to turn the fog off? Even if I have no fog enabled I see a white dust everywhere.


I just learned some time ago that vecFogColor.w carries a 0 or 1 if fog is enabled/disabled. So if you write instead:

Code:
Out.TexFog.z  = vecFogColor.w * (1 - saturate((vecFog.y - Out.Pos.z) * vecFog.z));



it should work.

Originally Posted By: thorus
hey guys how can i scale the texture ?


Use the function set_modelTex3Nm_tiling.

Originally Posted By: PadMalcom
I tried to use the shader that way (...) but my terrain remains white. Any idea why? The skins use exactly the same images as the demo.


The shader expects:

Quote:
entSkin1 = mask
entSkin2 = base texture
entSkin3 = texture 1, controlled by mask red channel
entSkin4 = texture 2, controlled by mask green channel

mtlSkin2 = base normalmap
mtlSkin3 = texture 1 normalmap
mtlSkin4 = texture 2 normalmap


whereas the blue channel of the mask in entSkin1 carries the shadowmap.

As can be seen in the .c file of the shader, mtlSkins 2, 3 and 4 are fetched automatically from entSkin 5-7:

Code:
e->material->skin2 = bmap_for_entity(e, 5);
e->material->skin3 = bmap_for_entity(e, 6);
e->material->skin4 = bmap_for_entity(e, 7);



That way you can just put all your textures, mask and normalmaps into the terrain entity file and you are done.

So, the way you are putting stuff into the terrain entity looks right. Maybe try bmap_to_mipmap(BMAP*) for each bitmap. Maybe the function bmap_for_entity fails somehow, try to replace the calls in init_modelTex3Nm with ent_getskin (don't forget the +1 shift on the index between bmap_for_entity and ent_getskin).

Please tell me if it still doesn't work. - As soon as the contest is over and I can return to my private project, I will also begin to write a new terrain shader, if you are looking forward for something fresh wink

Re: Multitex Terrain Normalmapping [Re: HeelX] #432713
11/13/13 01:46
11/13/13 01:46
Joined: Nov 2007
Posts: 318
Brasil, Paraná
NeoNeper Offline
Senior Member
NeoNeper  Offline
Senior Member

Joined: Nov 2007
Posts: 318
Brasil, Paraná
unearthing this topic!
Please could someone give me a hand.

I started using this shader in my terrain, but I can not add more than 3 lights dynamically in my game.
If I exceed this number, additional lights has no effect and sunlight to.

In an excerpt from the script I spotted the following:
Code:
float4 Pos		 : POSITION;
		float4 Color	 : COLOR0;
		float3 TexFog   : TEXCOORD0;
		float3 PosView  : TEXCOORD1;
		float3 Light1   : TEXCOORD2;
		float3 Light2   : TEXCOORD3;
		float3 Light3   : TEXCOORD4;
		float3 Diffuse1 : TEXCOORD5;
		float3 Diffuse2 : TEXCOORD6;
		float3 Diffuse3 : TEXCOORD7;


Intuitively I tried to add another TEXCOORDs for add more LIGHT, but no work.
It seems to me that I can not exceed this value [7], unfortunately I do not understand about shaders.

That the way I could use for more lights in my game using this shader?


Last edited by NeoNeper; 11/13/13 01:47.

Please! Use easy words to be translated. because my English is not very good! Grateful.
_______________________________________________________
Re: Multitex Terrain Normalmapping [Re: NeoNeper] #432724
11/13/13 12:27
11/13/13 12:27
Joined: Nov 2007
Posts: 318
Brasil, Paraná
NeoNeper Offline
Senior Member
NeoNeper  Offline
Senior Member

Joined: Nov 2007
Posts: 318
Brasil, Paraná
AnyBody?


Please! Use easy words to be translated. because my English is not very good! Grateful.
_______________________________________________________
Re: Multitex Terrain Normalmapping [Re: NeoNeper] #432725
11/13/13 12:39
11/13/13 12:39
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
hi,

the passable parameters are limited to (as I know) TEXCOORD0-7, COLOR0-3 (not sure), and FOG (this depends on shader model used). maybe you could combine somehow the lights in the vertex shader into the 3 parameters you are passing.

a while ago I made a terrain multitex shader handling tile normalmaps (based on the shade-c terrain shader), but it was slow for my purposes. maybe I can add this feature to my current terrain shaders in future...


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: Multitex Terrain Normalmapping [Re: sivan] #432747
11/13/13 18:01
11/13/13 18:01
Joined: Nov 2007
Posts: 318
Brasil, Paraná
NeoNeper Offline
Senior Member
NeoNeper  Offline
Senior Member

Joined: Nov 2007
Posts: 318
Brasil, Paraná
Quote:

the passable parameters are limited to (as I know) TEXCOORD0-7, COLOR0-3 (not sure), and FOG (this depends on shader model used). maybe you could combine somehow the lights in the vertex shader into the 3 parameters you are passing.


Thanks for the reply Sivan!
I do not understand shaders. Don't even know where I can start.

You know let me know if there is any more Multitexture Shader terrain that support more lights?

Last edited by NeoNeper; 11/13/13 18:05.

Please! Use easy words to be translated. because my English is not very good! Grateful.
_______________________________________________________
Re: Multitex Terrain Normalmapping [Re: NeoNeper] #432751
11/13/13 19:06
11/13/13 19:06
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
if you download my editor, or this demo: http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=430852#Post430852 , you can get some terrain shaders. they utilize vertex or pixel lights, switchable by commenting/uncommenting a #define line. in next update I will provide shader model 3.0 terrain shaders, having more instructions available, so they can work with 8 lights (maybe the shadowmapping demo already features it, I don't remember). but they lack normalmapping.


Free world editor for 3D Gamestudio: MapBuilder Editor
Page 4 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