Renderer Observations

Request new features or present your ideas.
Post Reply
bsp1t
Dretch
Posts: 56
Joined: Mon Oct 21, 2013 5:17 am UTC

Renderer Observations

Post by bsp1t »

So i started some styled light tests that work in other engines - here are some results.

First of all the links (and there are few) that i have been working from about light styles. Listed from most usefull to least.

http://q3map2.robotrenegade.com/docs/sh ... tyles.html

http://forums.warchest.com/showthread.p ... s%29/page2

http://www.urbanterror.info/forums/topi ... ge__st__10

http://openarena.wikia.com/wiki/Basic_shader_examples

Ok some notes before i forget.

Some shader manuals say you must use -nocollapse in the light phase. This appears to break all the shaders mapwide, and also breaks the light style. (why its called nocollapse when it actually collapses the shaders ill never know..) It exists because when you create a styled light, it generates many duplicate shaders for each brush it hits, or so the shader manual(s) say (in one form or another).

Any brush that gets light from a styled light needs a lightmapped shader. In the shader you need to create a lightmap (map $lightmap). This is the light from the style. In between the lightmap and the next stage (texture) you must add q3map_stylemarker between the stages so it picks up the light. If you are using a shader with an alpha channel you need to use q3map_styleMarker2.

example :
{
map $lightmap
}
q3map_stylemarker
{
map yourtexture
}

In order to make light styles work - add a "style" "1" to your light. Select a brush and add these example style 1's to the world spawn. The format is _styleNrgbgen/alphagen where N is the style number. Any rgbgen function can be used here.

_style1alphaGen wave sin .5 .3 .25 1.5
_style1rgbGen wave noise 0.5 1 0 5.37

In addition, a texture can only take a max of 3 style lights and 1 normal light beyond that you will have problems.

If you change a light, or a lightmapped shader you must recompile the map each time. You will notice that in the scripts dir q3map2 does some shader magic and leaves you a q3map2_mapname.shader . It will regenerate the file according to lightmap changes each time.

Ok those are the basics as far as i can see...

I have uploaded a pk3. Inside are 2 maps, "cube" and "cube_nocollapse" to illustrate the differences when not using -nocollapse. (cube is the one that semi-works). The .map files are included for developers.

PROBLEMS!

The map is made of 3 rooms. The first main area is where you can see the basics of the light style being taken up on the red cubes. The problem? the darkest cube (that shows no effect) is the one the light is just above! It seems the farther away from the light, the better the effect. The 2nd room is a cube with normal light. The 3rd room is a fire shader.

Texture notes : the walls are standard n/d/s. The red cube has no shader. Apparently no shader = the light works on it. If you deleted all the shaders the walls will show the lightstyle but you lose your /n/d/s (normal/diffuse/spec).

There is a texture techwall_01_lightmapped that is not in use. Apply it to a wall that is hit by the styled light and it goes black. Developers can experiment with this.

So without further adeiu i give you this lightmap testmap.

https://dl.dropboxusercontent.com/s/kmm ... t_mUX221NQ

Sorry there are no sshots, post any if you see something worth posting.

User avatar
Anomalous
Programmer
Posts: 318
Joined: Wed Mar 07, 2012 3:51 pm UTC

Re: Renderer Observations

Post by Anomalous »

That's “without further ado”…

Debian and Ubuntu packages (squeeze, wheezy, sid; 12.04, 12.10, 13.04) may work on derivatives

OFFEND! … no, that's not right… ATTACK!

gimhael
Programmer
Posts: 5
Joined: Fri Apr 13, 2012 7:49 am UTC

Re: Renderer Observations

Post by gimhael »

I tried your pk3 and there are (at least) two issues: a) the .shader files have to be in a directory called scripts/ and not shaders/, and b) the .bsp file contains no lightmaps.

bsp1t
Dretch
Posts: 56
Joined: Mon Oct 21, 2013 5:17 am UTC

Re: Renderer Observations

Post by bsp1t »

expand it and try recompiling it.

Post Reply