Page 1 of 1

Light tutorial

Posted: Thu Feb 17, 2005 7:32 pm
by Bjarne BZR
I made a tutorial on lights: http://www.gronnevik.se/rjukan/index.ph ... LightTypes

That link is also the new location of The Rjukan project

Posted: Thu Feb 17, 2005 9:04 pm
by Master-Of-Fungus-Foo-D
nice bjarne, but considering the MOUNTING demand for 'blinkie lights' ya might want ot put how to do that too :wink:

Posted: Fri Feb 18, 2005 12:10 am
by wacko
good one 8-)
I'm missing info about ambient vs ambientlight (or did I miss that?)

and surface lights DO light the scenery afaik, the value in

Code: Select all

	q3map_surfacelight (value)
in their shader just has to be high enough to make it visible (also depending on the surface's size)!
e.g. I made a monitor screen with a simple screenwshot as jpg and this shader:

Code: Select all

textures/desktop/monitor
{
	qer_editorimage textures/desktop/monitor.tga
	surfaceparm nomarks
	surfaceparm glass
 	surfaceparm nolightmap
	q3map_lightimage textures/desktop/monitor.tga
	q3map_surfacelight 200
	cull none
	{
	map textures/desktop/monitor.tga
	depthWrite depthWrite
	alphaFunc GE128
	}
}
and this does perfectly light the room 8-)

Posted: Fri Feb 18, 2005 8:41 am
by Bjarne BZR
Now this is the reason I'm having all my tutorials on a wiki: you guys have improvments: just add them to the tutorial! Just press "Edit page" at the bottom (no login required just write a name you want to be known as in the Author box when editing) and add your exelent additions.

Posted: Fri Feb 18, 2005 9:50 am
by wacko
Bjarne BZR wrote:Now this is the reason I'm having all my tutorials on a wiki: you guys have improvments: just add them to the tutorial! Just press "Edit page" at the bottom (no login required just write a name you want to be known as in the Author box when editing) and add your exelent additions.
muhaha, u asked me for it :twisted: wouldn't be the 1st time i crash ur wiki :wink:
ok. can't say much about ambient vs ambientlight, not sure about this myself :oops: .
I have done some changes about the surface lights and now I dont know how to upload this picture: Imageand how to place (nicely) the shader for it:

Code: Select all

textures/leucht/leucht
{
	qer_editorimage textures/leucht/leucht_blend.tga
	surfaceparm nomarks
	q3map_surfacelight 30000
	{
		map $lightmap
		rgbGen identity
	}
	{
		map textures/leucht/leucht.tga
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
	{
		map textures/leucht/leucht_blend.tga
		blendfunc GL_ONE GL_ONE
	}
}
Tell me how or even better do it for me :wink: thnx
Btw, in that pic, there's just that surface light (plus some ambient light) and a corona placed inside the "lamp". The shader is more complicate than neccessary, covering the possibility to have different images for use as the texture and the light emitting thing... Here, for example, the lamp looks rather white (the image leucht.tga) and gives yellowish light (image leucht_blend.tga) .The shader in my last post is easier and would be good enough for this example.

Posted: Fri Feb 18, 2005 11:54 am
by Bjarne BZR
Images are uploaded By entering

Code: Select all

Img:my_picture.jpg
This creates an upload link in the page.

Currently the uploading function is password protected, so I'll have to do the actual uploading for you, but the link you can setup yourself..

And to place code: just start any line you want like raw text with a space. Havent gotten around to creating dedicated code tags yet... I plan to add a section with formatting buttons to the edit page so you guys can cocentrate on content instead of wiki coding :)

Posted: Fri Feb 18, 2005 7:07 pm
by Bjarne BZR
That image is now upoaded Wacko.

Posted: Fri Feb 18, 2005 9:28 pm
by hogleg
Very nice, thanks :wink:

Posted: Fri Feb 18, 2005 11:24 pm
by wacko
Bjarne BZR wrote:That image is now upoaded Wacko.
hey thanks, m8 :D I just decided to start my 1st tries in doing it myself when I read ur post :wink: The shader is online too, now
And, I lost some words about the scripted lights 8-)

Posted: Sat Feb 19, 2005 10:24 am
by Bjarne BZR
Looking good M8