1 registered members (AndrewAMD),
1,244
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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
Serious User
|
Serious User
Joined: Mar 2006
Posts: 1,993
Karlsruhe
|
I tried to use the shader that way:
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
HeelX
Senior Expert
|
Senior Expert
Joined: Jul 2001
Posts: 6,904
|
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:
Out.TexFog.z = vecFogColor.w * (1 - saturate((vecFog.y - Out.Pos.z) * vecFog.z));
it should work. hey guys how can i scale the texture ? Use the function set_modelTex3Nm_tiling. 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: 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:
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
|
|
|
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
Senior Member
|
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:
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: sivan]
#432747
11/13/13 18:01
11/13/13 18:01
|
Joined: Nov 2007
Posts: 318 Brasil, Paraná
NeoNeper
Senior Member
|
Senior Member
Joined: Nov 2007
Posts: 318
Brasil, Paraná
|
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
Expert
|
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.
|
|
|
|