Old decal question.


(servinal) #1

Sorry if this is has been covered umpteen times b4, but Iv searched this whole forum and q3w and this is the closest thing I could find…

Originally posted by Neodymium:
Decals bug me for another reason entirely: overdraw. The very fact they require some very ugly kludging to prevent Z-fighting is suggestive.

Now, I would very much like an explanation of this ‘kludging’. Is there actually a way to stop a standard old school decal from z-fighting with bulletmarks and for that matter the player shadow??
Now, Iv heard that having the decal shader as nomarks fixes the bulletmarks at least, but in my experience this does Nothing because the bullet marks still show on the surface the decal shares its plane with. Still, I don’t really care as much about bulletmarks as I do the player shadow. Iv got quite a few ground based decals.

I also don’t want to use _decals because then they would all have to be patch meshes and create many more tris than needed.

Oh yeah, Im mapping for vq3, with plantlife q3map2.

Servinal


(pazur) #2

i would play around with the sort parameter and look if it fixes the z-fighting…

http://www.qeradiant.com/manual/Q3AShader_Manual/ch02/pg2_1.htm#sort

first i would try: sort banner
or written differently: sort 6

another idea would be to add surfaceparm nomarks (at least in rtcw the player shadow is gone when using this)


(servinal) #3

Ta pazur, sorting has solved the bulletmarks problem.

The decal shader already had nomarks as I stated above, but the bulletmarks from the base surface were still showing and z-fighting.
Adding ‘sort 6’ did fix this YAY and now it seems the bulletmarks on the base surface are drawn before the decal so that’s wicked and is working.

Now I just have the problem of the player shadow. It seems that even when the decal has a sort of 16 it isn’t drawn after the player shadow and z-fighting still occurs. Even if that did work is not a good solution as this means the decal also draws over all transparent objects such as glass, water and my lens flair effects.

Any other takers?

Alternatively, does anyone know a method, say by moding, where you can reassign the sort of the player shadow, or some other fix for this?? We are developing a mod so this is an option if it’s practical.

Servinal


(ydnar) #4

The solution is simple: don’t use depth-writing decals.

None of the ET decals/marks/shadows write to the zbuffer, and therefore never z-fight.

y


(servinal) #5

I assume thats a suggestion for the mod rather than a fix for my shaders in q3?


(obsidian) #6

It’s funny that you’ve quoted Neodymium of all the people in the world. Not sure if you’re aware of the history of that… but it’s all in the past now (thankfully).

Anyway, I don’t think ydnar was refering to ET specifically. Just that none of the ET decals used any sort of depth-writing in their shaders.


(servinal) #7

The selection of that quote was based solely on the fact that its the only reference in all of this or the q3w forums hinting at a possible fix for the decal problem. That my searching came up with anyway. In all reality the quote has nothing too do with my question but I thought Id include it too prove that Id actually tried to find the solution before asking.

With that second question, I was trying to get at…
Was he was suggesting using non depth-writing decals in q3 to fix the problem, or that the mod would have to use no depth-writing marks/shadows in addition too this for the principal too work.

In such a case where non depth-writing decals alone would fix the problem, I can’t seem to get it too work. Does this simply mean that the shader does not have the keyword ‘depthwrite’ in one if its stages, or is there an additional step Im not taking?


(The5thHorsemen) #8

you didn’t search very hard…
http://www.quake3world.com/ubb/Forum6/HTML/026306.html :bash:


(servinal) #9

Aaah, archives. My link went straight to LEM and I was missed them altogether. Ta.