a few sky questions


(heeen) #1

i want my sky to emit a bluish color of sky (ambient) light and additionally a yellowish colored sun light, how do i modify my current shader to generate that effect?

textures/heeen/shadowpeak_skybox
{
	qer_editorimage textures/heeen/shadowpeak
	surfaceparm noimpact
	surfaceparm nolightmap

	q3map_sun 1.00 1.00 1.00 100 270 35
// skylight or surfacelight??
//	q3map_surfacelight 80
//	q3map_skylight 65 3

	sunshader textures/skies_sd/full_moon2
	
	skyparms textures/heeen/shadowpeak - -

	{
		map textures/heeen/clouds.tga
		blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		tcMod scale 3.0 3.0
		tcMod scroll 0.003 -0.003
	}

}

also, is there any possibility to generate lensflares when looking into the sun?


(Emon) #2

Ambient light would light the entire level, even areas that the sky light doesn’t hit.

And I don’t know why you’d want yellow light for the sun. The sun emits white light.


(Hybridesque) #3

Simple, you set the color of the sunlight with the q3map_sun parameter to have the color of sunlight that you want. As for the ambient lighting from the skybox, you set the color you want in an image (TGA/JPEG, and only needs to be a few pixels), and you add the line to the shader q3map_lightimage, referencing the image. and use the q3map_skylight line to set the brightness.

Hybridesque.

Code goes like this…

textures/heeen/shadowpeak_skybox 
{ 
   qer_editorimage textures/heeen/shadowpeak 
   surfaceparm noimpact 
   surfaceparm nolightmap 
   q3map_lightimage textures/heeen/shadowpeak_light.tga
   q3map_sun 1.00 1.00 1.00 100 270 35 
// set the colour in the 1.0 1.0 1.0 bit, RGB (divide regular stuff by 255 to get what you want)
// skylight or surfacelight?? 
   q3map_surfacelight 80 
   q3map_skylight 65
   sunshader textures/skies_sd/full_moon2 
 
   skyparms textures/heeen/shadowpeak - - 

   { 
      map textures/heeen/clouds.tga 
      blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA 
      tcMod scale 3.0 3.0 
      tcMod scroll 0.003 -0.003 
   } 

}

(chavo_one) #4

Don’t use q3map_surfacelight, and the q3map_skylight line needs a second parameter. Read this to hear ydnar’s suggestions for writing q3map2 sky shaders.

http://www.splashdamage.com/forums/viewtopic.php?t=907#5160


(heeen) #5

yes, i know what the difference between sky and ambient light is, i just wanted to distinguish sky and sunlight a bit more so you know, what i mean. and the sun emits white light, of course, but on an early morning or evening the light gets filtered by the atmosphere and thus is yellow or orange :smiley:
thanks for the links guys