Dotproduct2 terrain. Shaders all have q3map_nonplanar, q3map_lightmapMergable, and one of q3map_shadeAngle 120 or q3map_shadeAngle 150. Blends look fine, lightmap does not. Two problems. One – certain hills where there are tris almost edge-on to the sun get large black spurious shadows, which are actually made WORSE by putting q3map_splotchfix in the shader; a couple areas where tris should be partialy in shade are glaringly bright. Specific triangles show up bright that should have shadows on them while the shadows appear correctly on their neighbors – the shadow edge just terminates at the bogus tri; certain other triangles appear dark except maybe at their edges… I’ve tried q3map_lightmapSampleOffset values such as 2, 4, 8, and even 32; I’ve also tried q3map_lightmapFilterRadius 8 0. Neither fixed the problem. Turning off -patchshadows when compiling gets rid of the worst of the black splotches. (The terrain is built of triangular flat patches instead of brushes – vertex editing brushes makes Radiant unstable, and it ends up the same thing anyway after -meta. The shadows not being cast on some tris problem persists – of course, self-shadowing by the terrain completely stops working, but brushes that cast shadows cast them on some triangles while others where the shadow should continue are bright.) Problem two – some sharp corners are apparent here and there where the terrain tris make angles well under 120. Phong shading seems to be working in places, but hit-and-miss. I got a rectangular brush with caulk on four faces and one terrain shader the other two (same on both and zero offsets, rotation, scaling etc. in Radiant’s surface inspector in fact) to come out obviously a brick, with a sharp corner, even though the shader used has q3map_shadeAngle 150, q3map_nonplanar, and q3map_lightmapMergable and the angle is a precise 90 degrees, way less than 150.
Aside from the editor image and actual blend stages, this is the shader on the rectangular brush that’s failing to phong shade:
q3map_nonplanar
q3map_shadeAngle 150
q3map_tcMod rotate 17
q3map_alphaMod dotproduct2 ( -0.3 0.0 0.85 )
q3map_lightmapFilterRadius 8 0
q3map_lightmapSampleOffset 32.0
q3map_lightmapMergable
The large lightmapSampleOffset is a holdover from earlier attempts to fix the darn splotches elsewhere; commenting it out doesn’t change anything.
Here’s the corresponding directives from one shader experiencing the problem with shadow casting – shadows where there should be none and no shadows in places where there should be some:
q3map_nonplanar
q3map_shadeAngle 150
q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
q3map_tcMod rotate 17
q3map_alphaMod dotproduct2 ( -0.3 0.0 0.85 )
q3map_lightmapFilterRadius 8 0
q3map_lightmapSampleOffset 8.0
q3map_lightmapMergable
This uses ivector and a saner lightmapSampleOffset.
And here are the relevant lines of the sky shader, the ones that actually generate light and affect shadowcasting from it:
q3map_sunExt 1 1 1 400 -30 45 2 12
q3map_skyLight 75 3
Ydnar may recognize them. 
And the compile command lines:
"C:\Program Files\Quake III Arena\Radiant\q3map_2.5.16_win32_x86\q3map2.exe" -connect 127.0.0.1:39000 -meta -samplesize 4 -v the_map
"C:\Program Files\Quake III Arena\Radiant\q3map_2.5.16_win32_x86\q3map2.exe" -connect 127.0.0.1:39000 -vis -v the_bsp
"C:\Program Files\Quake III Arena\Radiant\q3map_2.5.16_win32_x86\q3map2.exe" -connect 127.0.0.1:39000 -light -compensate 4 -fast -gamma 1.8 -patchshadows -samples 2 -scale 2 -v the_bsp
with the actual path to the .map and .bsp, respectively, in the obvious places. So it’s a recent enough q3map2, -meta is being used, the map is being vised (and it is not leaking, though that doesn’t show up in the compiler command template above of course), and lighting looks reasonably normal (this version is with -patchshadows).
The shaders’ names’ path part is the name of my map and unlikely to be duplicated anywhere else; also there’s not very much on my shaderlist.txt, although the shaders for this map I’m working on certainly are (along with a third party texture set and the stuff that comes with Quake III, including “common”). I’ve triple-checked that I’m not doing anything boneheaded in any of the shaders, with paths, with shaderlist.txt, or with keeping finding nothing’s changed only to realize q3 is loading the map from a pak file and not from the most recently compiled .bsp.
(it happens!) I think the problems might not actually be related – the splotching/shadowcasting issues seem confined to the patches in the map, while I’ve succeeded in exhibiting the phong shading problem on a brush.
Anyone have any suggestions or ideas what might be going wrong?


