Shader landmine problem.


(DAbell) #1

Hi all i’m having a slight problem with the ground texture on my current map project, at the moment the ground is just a texture so you can’t plant mines on it.

I used the following code to change my texture into one that could have land mines planted in it.


textures/nazaire_skies/dirt_brwn
{
	qer_editorimage textures/nazaire/dirt_brown.jpg
	surfaceparm gravelsteps
	surfaceparm landmine
	{
	map textures/nazaire/dirt_brown.jpg
	}
}

But when i compile the map the shader shows up as really bright compared to the normal ground that has just the texture applied to it, i think its something to do with adding a lightmap line to the shader but i’ve tried a few and it turned blue, disappeared or just didn’t work.

Also i have the water not effected by the light in the proper manner, again a lightmap issue please could you show me where the light map section could go in the following shader.


textures/liquids_sd/siwa_water_2
{
	qer_editorimage textures/liquids_sd/siwa_water.tga
	qer_trans .5
	q3map_globaltexture
	cull disable
	nocompress
	nofog
	surfaceparm nomarks
	surfaceparm nonsolid
	surfaceparm trans
	surfaceparm water
	waterfogvars ( 0.11 0.13 0.15 ) 0.2
	nopicmip
	{
		map textures/liquids_sd/siwa_water.tga
		blendFunc blend
		alphaFunc GE128
		rgbgen identity
		tcmod scale 0.5 0.5
		tcmod scroll -.02 .001
		fog on
	}
	{
		map textures/liquids_sd/seawall_ripple1.tga
		blendFunc GL_ONE GL_ONE
		rgbGen wave sin 0.3 0.02 0 0.25
		tcmod scale 0.01 0.01
		tcmod scroll -.001 -.0002
		fog on
	}
	{
		map textures/liquids_sd/seawall_ripple1.tga
		blendFunc GL_ONE GL_ONE
		rgbGen wave sin 0.1 0.03 0 0.4
		tcmod scale 1 1
		tcmod scroll -.005 -.001
		fog on
	}
	{
		map textures/liquids_sd/siwa_shimshim1.tga
		blendFunc GL_ONE GL_ONE
		rgbGen wave sin 0.4 0.02 0 0.3
		tcmod transform 0 1.5 1 1.5 2 1
		tcmod scroll .005 -.001
		fog on
	}
}

I will ony use this standard shader as a basis for mine so i don’t need telling not to change stock shaders.

Thanks if you can help.

D


(sock) #2

I used the following code to change my texture into one that could have land mines planted in it.

But when i compile the map the shader shows up as really bright compared to the normal ground that has just the texture applied to it, i think its something to do with adding a lightmap line to the shader but i’ve tried a few and it turned blue, disappeared or just didn’t work.

Use implicit shaders. They can be helpful in setting up the default light stages for you. Like this for example:

textures/egypt_floor_sd/mudroad01
{
	surfaceparm landmine
	surfaceparm gravelsteps
	implicitMap -
}

You still get all the custom surfaceparms but the rest fo the shader is defined for you. BTW this is an ET feature only and will not work in other Q3 engines. (as far as I’m aware)

Also i have the water not effected by the light in the proper manner, again a lightmap issue please could you show me where the light map section could go in the following shader.

Can you provide a screenshot? The original shader does not have a light stage either so what you have is a perfect copy with a different name.

Sock
:moo:


(DAbell) #3

Yeah i have posted the original shader so someone could hopefully point out where to put the lightmap section or sections in the shader i tried doing my own from scratch unsuccesfully so i thought i would base it on existing working shader. i know this one doesn’t have the light stage so thats why i was asking where and how to add it.

Also sock can you tell me if the battery fog should work cos i’m looking for the same effect as used on battery ie fog out to sea but not so much inland.


(DAbell) #4

I tried adding the implicit line to my shader and once i compiled it, it gave me the OGOD (Orange Grid Of Death).


textures/nazaire_skies/dirt_brwn
{
	qer_editorimage textures/nazaire/dirt_brown.jpg
	surfaceparm gravelsteps
	surfaceparm landmine
	implicitMap -
}

I also tried adding the texture path after the implicit map command as per the LDR and still got the OGOD.

I hope someone can cure my stupidity.


(Shallow) #5

implicitmap -” only works where the shader name and path is exactly the same as the image name and path. You’ve got three ways to fix it. Either:

  • rename and move your dirt texture to have the same as the shader name (nazaire_skies/dirt_brwn.jpg)
  • rename the shader and path to match the texture name and path (nazaire/dirt_brown)
  • specify the correct image path for the implicitmap (implicitmap textures/nazaire/dirt_brown.tga)

(G0-Gerbil) #6

Change it to:

textures/nazaire_skies/dirt_brwn 
{ 
   qer_editorimage textures/nazaire/dirt_brown.jpg 
   surfaceparm gravelsteps 
   surfaceparm landmine 
   implicitMap textures/nazaire/dirt_brown.jpg 
} 

You’ve basically got (either intentionally or as a typo) a discrepency between your shader name and the texture it uses.