Lighting problem...


(MrDiffrence) #1

I’ve been having a sky lighting issue for the last 3 days with Ruins so I’m going to ask for some help on it. Specific area objects (signs, fence, specific outside areas) are near black while others are fine, adjusting the sun brightness makes the fine areas white washed and the black areas semi-remain.

Here are my shaders;

Sky:


textures/x_skies/night
{
	skyparms textures/x_skies/env/night 1024 -

	q3map_lightImage textures/x_skies/night_clouds.tga

	q3map_sunExt 1 1 1 30 -30 50 .5 16
	q3map_sun 1 1 1 10 -30 50 
	q3map_lightmapFilterRadius 0 5
	q3map_skyLight 120 5
	q3map_lightmapSize 512 512
	q3map_lightmapSampleSize 8
	q3map_noFast
	
	surfaceparm sky
	surfaceparm noimpact
	surfaceparm nodlight
	surfaceparm lightfilter

	nopicmip
	nomipmaps

	qer_editorimage textures/x_skies/night_clouds.tga

	{
		map textures/x_skies/night_clouds.tga
		tcMod scale 3 3
		tcMod scroll 0.005 -0.0125
		rgbGen identityLighting
	}
	{
		map textures/skies/topclouds.tga
		blendFunc GL_ONE GL_ONE
		tcMod scale 3 3
		tcMod scroll 0.015 -0.0225
		rgbGen identityLighting
	}
}

Fence:


textures/x_downtown/wood40M
{
     qer_editorimage textures/x_downtown/wood40M.tga
     cull disable
     surfaceparm alphashadow
     surfaceparm trans	
     surfaceparm nomarks
     
        {
      map textures/x_downtown/wood40M.tga
      alphaFunc GE128
      depthWrite
      rgbGen vertex
        }
        {
		map $lightmap
		rgbGen identity
		blendFunc filter
		depthFunc equal
	}
}

Few shots;

I had this previously when I had to manually place lights in front of the fence, unfortunately it never seemed to turn out the way I wanted and was always giving me grief.

The effect I’m looking for is more realistic lighting, no black areas, no over white areas, just various light/dark shades. I’ve been compiling with;

bsp -meta
vis -normal
light -fast -samples 3

Any help would be mucho appreciated!


(MrDiffrence) #2

Just in case my fire is somehow related to this;


textures/x_sfx/flame1
{
	surfaceparm nomarks
	surfaceparm trans
	cull none
	q3map_surfacelight 750
	

	{
		animMap 10 textures/x_sfx/flame1.tga textures/x_sfx/flame2.tga textures/x_sfx/flame3.tga textures/x_sfx/flame4.tga textures/x_sfx/flame5.tga textures/x_sfx/flame6.tga textures/x_sfx/flame7.tga textures/x_sfx/flame8.tga
		blendFunc GL_ONE GL_ONE
		rgbGen wave inverseSawtooth 0 1 0 10
		
	}	
	{
		animMap 10 textures/x_sfx/flame2.tga textures/x_sfx/flame3.tga textures/x_sfx/flame4.tga textures/x_sfx/flame5.tga textures/x_sfx/flame6.tga textures/x_sfx/flame7.tga textures/x_sfx/flame8.tga textures/x_sfx/flame1.tga
		blendFunc GL_ONE GL_ONE
		rgbGen wave sawtooth 0 1 0 10
	}	


	{
		map textures/x_sfx/flameball.tga
		blendFunc GL_ONE GL_ONE
		rgbGen wave sin .6 .2 0 .6	
	}

}


(ydnar) #3

Change your shaders to these. Notice the changes, which are significant (no lightmap stuff on the sky, for instance):


textures/x_skies/night
{
	qer_editorimage textures/x_skies/night_clouds.tga
	
	q3map_lightImage textures/x_skies/night_clouds.tga
	
	// you don't need both sun and sunExt unless you're mapping for rtcw
	// and want a light flare on the sun
	// also, your sun is really really dark (30 brightness)
	// I'd crank it up to 150 or more, and bring down the brightness of your skyLight
	q3map_sunExt 1 1 1 30 -30 50 .5 16
	q3map_sun 1 1 1 10 -30 50
	
	q3map_skyLight 120 5
	
	surfaceparm sky
	surfaceparm noimpact
	skyparms textures/x_skies/env/night 1024 -
	
	{
		map textures/x_skies/night_clouds.tga
		tcMod scale 3 3
		tcMod scroll 0.005 -0.0125
		rgbGen identityLighting
	}
	{
		map textures/skies/topclouds.tga
		blendFunc GL_ONE GL_ONE
		tcMod scale 3 3
		tcMod scroll 0.015 -0.0225
		rgbGen identityLighting
	}
} 

Note that the first stage should use rgbGen identity if you have a lightmap stage, which encodes lighting data. No need for vertex lighting as well:


textures/x_downtown/wood40M
{
	qer_editorimage textures/x_downtown/wood40M.tga
	surfaceparm alphashadow
	surfaceparm trans   
	surfaceparm nomarks
	cull disable

	{
		map textures/x_downtown/wood40M.tga
		rgbGen identity
		alphaFunc GE128
		depthWrite
	}
	{
		map $lightmap
		rgbGen identity
		blendFunc filter
		depthFunc equal
	}
} 

You might want to look at some of the example skies I’ve done. What game are you mapping for, anyway?

y