Need some Phong Shading pointers.


(Raven) #1

Ydnar: Your new version of q3map2 changed the way our phong shaders work. I had an angle of 120 and suddenly I ended up with stark black lines where terrain brushes meet in a couple of places. They used to not be there. I lowered the angle to 60, like Zer0L0giC suggested, but that still did not get rid of them all. I was under the false impression that whatever angle I placed in the shader would cause phong shading to happen to all angles less than and equal to the set angle. That is why I used higher values. I don’t want to have to decrease the amount of Phong shading if I don’t have to. I want a lot of smoothing and I want to overcome these strange brush edge problems. How does one choose a correct phong shading angle for a terrain? Thanks for your input.

Here is an example of one of my phong shaders:

[b]
textures/ford/ground_Phong
{
// q3map_nolightmap

// q3map_onlyvertexlighting

q3map_shadeangle	60
qer_editorimage	textures/ford/ground
q3map_splotchfix
q3map_nonplanar
{

// rgbGen vertex

    map textures/ford/ground
    rgbGen identity
}
{
    map $lightmap
    blendFunc GL_DST_COLOR GL_ZERO
    rgbGen identity
}

}
[/b]


(ydnar) #2

Does the black line follow the edge of the triangles or perpendicular?

Try replacing q3map_splotchFix with q3map_lightmapSampleOffset 4 (or 8) and see if that corrects it. It may be a bad joint where the nonplanar mapping failed to correctly find the position of the edge case.

y


(Raven) #3

Cool thanks Ydnar. I was actually going to try something along those lines. I am going to try and break up the offending brush into a number of brushes and pull a few verts. Maybe they just need to have some more character.