bullet marks on water surface


(Quaker-X) #1

Odd problem here. I have two water shaders, one used for a large portion of the map and a smaller one used for another section. Relatively the same shaders, however, the smaller water shader creates bullet marks on the surface when shot at.

Screenie:

Shader:


textures/duelx_1/water_small
{
	qer_editorimage textures/duelx_1/water.tga
	q3map_tessSize 2048
	q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
	
	surfaceparm nonsolid
	surfaceparm trans
	surfaceparm water
	surfaceparm pointlight
	
	cull none
	sort additive
	
	deformVertexes wave 0.1 sin 0.1 0.1 0.1 0.1
	
	{
		map textures/duelx_1/water.tga
		blendFunc GL_SRC_ALPHA GL_ONE
		rgbGen identity
		alphaGen vertex
		tcMod scroll 0.01 0.025
	}
	{
		map textures/duelx_1/water.tga
		blendFunc GL_SRC_ALPHA GL_ONE
		rgbGen identity
		alphaGen vertex
		tcMod scale 1.5 1.5
		tcMod scroll -0.0075 -0.03
		rgbGen identity
	}
}


(WolfWings) #2

Fixed Shader:


textures/duelx_1/water_small
{
	qer_editorimage textures/duelx_1/water.tga
	q3map_tessSize 2048
	q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
	
        surfaceparm nomarks
	surfaceparm nonsolid
	surfaceparm trans
	surfaceparm water
	surfaceparm pointlight
	
	cull none
	sort additive
	
	deformVertexes wave 0.1 sin 0.1 0.1 0.1 0.1
	
	{
		map textures/duelx_1/water.tga
		blendFunc GL_SRC_ALPHA GL_ONE
		rgbGen identity
		alphaGen vertex
		tcMod scroll 0.01 0.025
	}
	{
		map textures/duelx_1/water.tga
		blendFunc GL_SRC_ALPHA GL_ONE
		rgbGen identity
		alphaGen vertex
		tcMod scale 1.5 1.5
		tcMod scroll -0.0075 -0.03
		rgbGen identity
	}
}

You forgot the ‘surfaceparm nomarks’ line, hon.


(Quaker-X) #3

Hah, thanks. Always something simple like that.

Odd though, my large water shader is basically the same shader, and yet it works.


(obsidian) #4

(Nevermind) Don’t know what I was thinking.


(ydnar) #5

Surfaceparm noimpact should be reserved for sky surfaces. It removes the impact (and projectile) completely. This is why rockets disappear when you shoot the sky.

y


(Fracman) #6

And now: how to create ripples on the water on bullet impact?
Kind of animated marks that disappear…


(Mr_Tickles) #7

Lol, you could use thousands of triggers and animMap shaders :slight_smile:

And this for when the bullets hit:
Check Appendix A of the shader manual.

I suppose it would be better if there was a trigger brush that could give variables to the shader, this would work a treat. hint hint. :smiley: (Is there anything like that? :???:slight_smile:


(WolfWings) #8

Actually a ‘water hit’ mark shader would be all that’s needed. Classify water as a type of material, and have a special ‘hit shader’ that ripples a little once, expands, and fades out in a fixed fragment of time would get close to the effect you wanted, I’d imagine. Though you’d likely need a fragment of client-side code to let the ‘water hit’ shader start and sync at the moment of the bullet impact, unless you just did a generic ‘turbulence’ shader.

But from a shader standpoint I wouldn’t see it being that much different than supporting dirt, snow, wood, metal, and glass seperately like ET already does. The dirt or snow handling would be a good basis for the effect, in fact.


(Fracman) #9

Thanks for the nice ideas!

Actually i’m working with JA…
please remember Q3Map2 is there for all Q3 engine games :poke:

:smiley:


(WolfWings) #10

I do remember that Q3Map2 isn’t just for ET, but ET is a publically available source to poke around in, and I don’t have most of the other Q3 games installed, so I don’t know what they’re capable of individually. ET also seems to be a good yardstick (and source of code) to look at for mods if you’re trying to implemeny a visual effect for a map as well, which is why I referenced it.


(Fracman) #11

yeah, definitely :slight_smile:
Unfortunately, only MP portion of code is available in JA and its functionality is pretty different from MP, where not everything is programmable.


(ydnar) #12

q3map_material water

IIRC that’s what tells JK2/JA to produce water impacts.

y


(Fracman) #13

Strange. I have a shader with this, and with surfaceparm water,
and blaster shots just go thru.


(WolfWings) #14

Do the blaster shots normally generate ripples on impacting with water surfaces in the normal game then?

If so, copy all the surfaceparm settings from one of the built-in level shaders, figure out what you’re missing.


(ratty redemption) #15

why would a shader with surfaceparm nonsolid, also need surfaceparm nomarks? …doesn`t nonsolid stop any detection of projectiles on the surface or is it just a content parm?


(ydnar) #16

It can still be marked up, even if nonsolid.

surfaceparm nodraw, on the other hand, implicitly sets nolightmap, nomarks, etc. because there is no visible drawsurf generated.

y


(ratty redemption) #17

ah, that makes sense, thanx ydnar :slight_smile: