How to adjust light intensity with shader?


(mika_x) #1

Hi people.
I am new to mapping :slight_smile:

I made a brush with a texture that emits light.
Below is the shader file:
(I did put the name of the shader file into shaderlist.txt, and I also put the shader file in the .pk3 file)


{
	qer_editorimage textures/test/shine.tga
	q3map_backsplash 0 0
	q3map_lightsubdivide 64
	q3map_globaltexture 
	cull disable 
	surfaceparm nolightmap
	surfaceparm solid
	surfaceparm trans
	{
		map textures/test/shine.tga
		tcGen environment
        	tcMod turb 0 0.1 0 0.1
        	tcmod scroll .1 .1
		blendfunc GL_ONE GL_ONE
	}
}

The problem is… it looks good when I do devmap to play in the .bsp.
but after I put everything to a .pk3 file and played it on a server.

The brush became too bright that the original color of the light became white. The light was blue when I use devmap *.bsp, but it became white when I play in a .pk3 map.

I don’t understand why is there the difference…I think if I reduce the light intensity in the shader it might shows blue again… but I don’t know how :confused:

Please help. Thanks :slight_smile:


(Mateos) #2

Good morning,

Here you go :slight_smile:
http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html

This is the full shader documentation :slight_smile:

Edit: cull disable looks strange for a light emitting shader :confused: And making the texture move with the scroll? o.o

Edit 2: Rha, Obsidian may have edited the article. Here’s another link:
http://www.gd-experience.eu/index.php?viewPost=63
http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_surfaceLight

Also you may tweak the compilation as you wish with this:
http://en.wikibooks.org/wiki/Q3Map2/Light


(twt_thunder) #3

the shader might need the same name as map in pk3, but I am not sure :slight_smile:


(Mateos) #4

No, you can name it as you feel like :slight_smile: Even the shaders can be named as you wish (I use some textures/mateos/sometest while the folder mateos does not exist physically).


(mika_x) #5

[QUOTE=Mateos;459135]Good morning,

Here you go :slight_smile:
http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html

This is the full shader documentation :slight_smile:

Edit: cull disable looks strange for a light emitting shader :confused: And making the texture move with the scroll? o.o

Edit 2: Rha, Obsidian may have edited the article. Here’s another link:
http://www.gd-experience.eu/index.php?viewPost=63
http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_surfaceLight

Also you may tweak the compilation as you wish with this:
http://en.wikibooks.org/wiki/Q3Map2/Light[/QUOTE]

There is no ‘q3map_surfaceLight’ so how do I do that?..
Yes. the scroll makes the texture move so it kinda looks like water.
also I am actually not sure about the cull disable… so do I change it to cull front/back or just don’t use cull at all…?

What do I do with the compilation options?
I always used the simulate old style option in GtkRadiant 1.6…

Last questoin… do you have any idea why is there difference with .bsp and .pk3 maps ? :confused:
Like I said the brush became white when I run the pk3 but its blue(good) when its .bps.

P.S. the brush is actually consist of 5 same brushes.


(mika_x) #6

[QUOTE=Mateos;459135]Good morning,

Here you go :slight_smile:
http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html

This is the full shader documentation :slight_smile:

Edit: cull disable looks strange for a light emitting shader :confused: And making the texture move with the scroll? o.o

Edit 2: Rha, Obsidian may have edited the article. Here’s another link:
http://www.gd-experience.eu/index.php?viewPost=63
http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_surfaceLight

Also you may tweak the compilation as you wish with this:
http://en.wikibooks.org/wiki/Q3Map2/Light[/QUOTE]

I don’t see ‘q3map_surfaceLight’ in the shader file what should I do??


(stealth6) #7

It’s really weird that you say it’s working on local host and not in a pk3 :confused:

According to the shader you posted I don’t think it should be emitting any light at all, since as you said you’re missing the q3map_surfacelight. I’m not sure what:
q3map_backsplash 0 0
q3map_lightsubdivide 64

does so maybe that has something to do with it. Quick google says this:

Light emitting shaders are also lit by the light they produce, and backsplash controls the distance and percentage of that light. Increasing the distance will probably help your situation.

Light subdivide will give you a finer distribution of point lights.

so without surfacelight I don’t know how it’s emitting light on localhost.

One thing I do notice is surfaceparm nolightmap which means the texture isn’t effected by light so it will always be really bright, but not light emitting. You can read about surfaceparms here (Q3 shader manual): http://toolz.nexuizninjaz.com/shader/

As for pk3 vs local host, first off are you mapping in a clean install? Otherwise their might be other custom shaders interfering. If that’s not the case then check you included everything in the pk3 file. (inside the maps folder there is another folder with your map name and inside that there are lots of lm_xxx.tga file, I think those also have to do with lighting)

What I do when I make the pk3 is open the maps file and search for the map name, then you need to select all the files & the one folder that appears. Then deselect the .bak and .map file - this is everything you pk3 maps folder need to contain. After that add your shaders to the scripts folder of the pk3 and you should have everything (lighting wise).


(mika_x) #8

[QUOTE=stealth6;459333]It’s really weird that you say it’s working on local host and not in a pk3 :confused:

According to the shader you posted I don’t think it should be emitting any light at all, since as you said you’re missing the q3map_surfacelight. I’m not sure what:
q3map_backsplash 0 0
q3map_lightsubdivide 64

does so maybe that has something to do with it. Quick google says this:

so without surfacelight I don’t know how it’s emitting light on localhost.

One thing I do notice is surfaceparm nolightmap which means the texture isn’t effected by light so it will always be really bright, but not light emitting. You can read about surfaceparms here (Q3 shader manual): http://toolz.nexuizninjaz.com/shader/

As for pk3 vs local host, first off are you mapping in a clean install? Otherwise their might be other custom shaders interfering. If that’s not the case then check you included everything in the pk3 file. (inside the maps folder there is another folder with your map name and inside that there are lots of lm_xxx.tga file, I think those also have to do with lighting)

What I do when I make the pk3 is open the maps file and search for the map name, then you need to select all the files & the one folder that appears. Then deselect the .bak and .map file - this is everything you pk3 maps folder need to contain. After that add your shaders to the scripts folder of the pk3 and you should have everything (lighting wise).[/QUOTE]

Thanks for the information.
I got what I want by putting ‘rgbGen const’ in the shader file.

and I might be confused because it looked so bright I thought it was emitting light. :slight_smile: