shadow seams on irregular geometry


(laerth) #1

I’ve got a bunch of walls constructed of 4-vertex, 4-face detail brushes that occasionally yield some ugly, aliased shadows between brush seams when lit from a certain angle.

q3map2 -skyfix -meta -samplesize 4 -v
q3map2 -vis -saveprt -v
q3map2 -light -fast -samples 3 -gamma 2 -compensate 4 -v

The above switches produce the following:

Adding -filter to the light stage disguises the effect to some extent…

…but maybe there’s a better solution out there?


(ratty redemption) #2

does the shader your using have a q3map_shadeangle? …good values are from 120-180.

you could also try using in your shader, q3map_lightmapsampleoffset which samples light from n units off the surface, ie not in the ‘creases’ as much, although it doesn`t always fix this type of lighting problem.

another trick that can help is func_grouping the affected brushes and giving the group a low _lightmapscale like 0.25 or 0.1.

hth


(ydnar) #3

Looks like the hidden sample finding isn’t working with those brushes.

The non-textured faces, are they caulk or nodraw? Make sure they’re caulk or some similarly solid/opaque (but non-drawing) shader, otherwise Q3Map2 won’t be able to determine if the samples are occluded inside a brush, and the seams will cast shadows.

If they’re already properly caulked, back up the area behind the facet brushes with a big block of solid caulk so Q3Map2 knows that the area behind the brushes is occluded. Sometimes when you have two brushes meeting at an acute angle, Q3Map2 thinks the edge samples aren’t occluded. Another option would be to extrude the brushes out == along the nearest axis into the wall.

y


(laerth) #4

Awesome, filling up the space behind the offending brushes with solid caulk brushes fixed the problem.

Thanks for the quick replies.


(ratty redemption) #5

cool and useful post ydnar, Ill that with the similar problem Ive been having.


(ydnar) #6

BTW Laerth, long time. What’s up?


(laerth) #7

Hey ydnar, yes it’s been awhile. PM forthcoming…