Quake3World.com Forums
     Level Editing & Modeling
        How to tune vertex light?


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: How to tune vertex light?

Mercenary
Mercenary
Joined: 15 Feb 2010
Posts: 213
PostPosted: 10-22-2018 06:31 AM           Profile Send private message  E-mail  Edit post Reply with quote


Since I use -dirty a lot in the light compile phase, I ran into a slight problem with the resulting vertex-light.

-dirty makes all the the corners and angles a little bit darker, exactly where most of the vertices sitting around and waiting for some light rays. :D
This leads often to a very dark or uneven vertex-light.

Is there any good way of tune the vertex-light just a little bit?


Things I already tried:

_minvertexlight in the worldspawn: makes the light too flat in the former dark corners. The sens of depth is lost, with high picmip values.
-cpma key during light compile: makes the map way to bright. A mixture between this and the default vertex light would be perfect. If there were a value for the -cpma key to control the thing a little bit, that would be great!



_________________
Q3A Maps - by sst13
Quake Live Workshop


Top
                 

Mercenary
Mercenary
Joined: 15 Feb 2010
Posts: 213
PostPosted: 10-26-2018 10:12 AM           Profile Send private message  E-mail  Edit post Reply with quote


Ok ladies, I found a very funny way to mix the default vertex light with the -cpma vertex light.

1. I compiled both versions into 2 seperate BSP files (BSP & light stage)
2. turned these 2 BSPs into TGA graphics
3. used a graphic editor to mix these images together
4. turned the resulting TGA graphic back into a BSP file
5. continued to compile the VIS & AAS stage
6. celebrated myself as it worked :D

The results with different mix ratios:
Image

What a BSP looks like as a graphic:
Image




How to do it:

Here are the command lines for compiling the first part: (You may add additional switches and the full paths to your q2map2.exe, bspc.exe, and your mapfiles.)
Code:
//create a second map file
copy "mapname.map" "mapname_cpma.map"

//compile BSP & light with original vertex light
q3map2.exe -meta mapname.map
q3map2.exe -light mapname.bsp
copy "mapname.bsp" "mapname.raw"
del "mapname.bsp"

//compile BSP & light of the second map with cpma vertex light
q3map2.exe -meta mapname_cpma.map
q3map2.exe -light -cpma mapname_cpma.bsp
copy "mapname_cpma.bsp" "mapname_cpma.raw"
del "mapname_cpma.bsp"

//pause for editing the graphic files
pause


You now got 2 *.raw files, you have to import into your graphic editor of choice.
Use the following parameters:

Image widht = 1024
Image height = filesize of the raw file in bytes, divided by 3072. (round up the value) Why 3072? Because 1024 x 3byte per pixel (rgb).
Bits per pixel = 24
Color order = rgb
Interleaved = Yes

If your graphic editor don't support importing *.raw files, you can use https://www.irfanview.com/ for this to create other formats like TGA.

Blend the graphics with the desired ratio.
Then export back into a mapname.raw file with BPP 24, Color order rgb interleaved.


Compiling the second part:
Code:

//continue to compile VIS & AAS stage
copy "mapname.raw" "mapname.bsp"
q3map2.exe -vis mapname.bsp
bspc.exe -optimize -forcesidesvisible -bsp2aas mapname.bsp
pause



Have fun... sst13



_________________
Q3A Maps - by sst13
Quake Live Workshop


Top
                 

Gibblet
Gibblet
Joined: 17 Dec 2016
Posts: 10
PostPosted: 10-26-2018 06:29 PM           Profile Send private message  E-mail  Edit post Reply with quote


That's really interesting and good work figuring that out.

I wonder how it would turn out to invert the vertex light and use that to subtract from an enhanced lightmap, to add even more contrast to the visuals. Or maybe to shift hues to give an iridescent quality to everything.




Top
                 

Warrior
Warrior
Joined: 14 Aug 2016
Posts: 81
PostPosted: 10-26-2018 08:51 PM           Profile Send private message  E-mail  Edit post Reply with quote


turned these 2 BSPs into TGA graphics
I'm nothing.. :miffed: :disgust: :D

How to tune vertex light?
@sst13, just one question: who still needs this? :question:




Top
                 

Mercenary
Mercenary
Joined: 15 Feb 2010
Posts: 213
PostPosted: 10-28-2018 10:02 AM           Profile Send private message  E-mail  Edit post Reply with quote


Obsessed wrote:
just one question: who still needs this? :question:

It's probably not a need of performance anymore, but there are always some "pro-gamer" playing with vertex light + high picmip & other fancy stuff. :D



_________________
Q3A Maps - by sst13
Quake Live Workshop


Top
                 

Warrior
Warrior
Joined: 14 Aug 2016
Posts: 81
PostPosted: 10-28-2018 11:52 AM           Profile Send private message  E-mail  Edit post Reply with quote


@sst13, hmm, may I ask about something different, but similar by it's nature? I've got an error "WARNING: reused image textures/gothic_block/blocks18cgeomtrn2.tga with mixed glWrapClampMode parm" (twice), but: 1) in the game everything is ok, 2) this is an ID's texture/shader and I didn't "reuse" it (the shader). so, I can leave it as is, but my perfectionism pushes me to correct it. :( what could it be? :)




Top
                 

Mercenary
Mercenary
Joined: 15 Feb 2010
Posts: 213
PostPosted: 10-28-2018 03:51 PM           Profile Send private message  E-mail  Edit post Reply with quote


@Obsessed:
This warning occurs when a texture is used in multiple shaders, but using different texture-mapping methodes like map and clampmap.

map tiles the texture infinite.
clampmap produces only a single tile.



_________________
Q3A Maps - by sst13
Quake Live Workshop


Top
                 

Warrior
Warrior
Joined: 14 Aug 2016
Posts: 81
PostPosted: 10-29-2018 01:53 AM           Profile Send private message  E-mail  Edit post Reply with quote


texture is used in multiple shaders, but using different texture-mapping methodes
@sst13, Thank you very much! But what confuses me: I've made a simple box (this is Q3A) with a square brush on the wall, marked it's 1 side with the same texture (blocks18cgeomtrnx.tga - I've just taken it from the "error-map"), and there was no any error message. I just don't know, what did I do to make the error appear and therefore, how to fix it. :D Anyway, if this is a difficult case, I can just leave it as is.

P.S. OMG, I'm already A WARRIOR! :owned: >:D




Top
                 

This is not Æon!
This is not Æon!
Joined: 20 Jan 2002
Posts: 2161
PostPosted: 10-29-2018 11:07 AM           Profile Send private message  E-mail  Edit post Reply with quote


Interesting!

I tend to use vertex these days where I find no use for lightmaps (small things and things that are evenly surfaces), both to speed up compile and reduce the bsp size a bit and you get some performance there too. But I light very differently these days, much more optimized than when I was younger I feel.



_________________
Q3Map2 2516 -> http://www.zfight.com/misc/files/q3/q3map_2.5.16_win32_x86.zip
Q3Map2 FS_20g -> http://www.zfight.com/misc/files/q3/q3map2_fs_20g.rar
GtkRadiant 140 -> http://www.zfight.com/misc/files/q3/GtkRadiantSetup-1.4.0-Q3RTCWET.exe


Top
                 

Mercenary
Mercenary
Joined: 15 Feb 2010
Posts: 213
PostPosted: 10-29-2018 05:34 PM           Profile Send private message  E-mail  Edit post Reply with quote


Obsessed wrote:
I've made a simple box (this is Q3A) with a square brush on the wall, marked it's 1 side with the same texture (blocks18cgeomtrnx.tga - I've just taken it from the "error-map"), and there was no any error message. I just don't know, what did I do to make the error appear and therefore, how to fix it.

The "blocks18cgeomtrnx" shader is using the "blocks18cgeomtrn2" texture with the default map key.
If you add a shader like "/sfx/healthfloor" to your map, where the same texture is used but with the clampmap key, then the warning occures.
Because Q3 don't know how to handle the texture, tiled or clamped.

If both shader look fine you can ignore this warning. (it's just a warning, not an error)

If you really want to get rid of the warning message, you have to rewrite one of the involved shaders by renaming the shader and changing the map or clampmap key.



_________________
Q3A Maps - by sst13
Quake Live Workshop


Top
                 

Warrior
Warrior
Joined: 14 Aug 2016
Posts: 81
PostPosted: 10-29-2018 10:48 PM           Profile Send private message  E-mail  Edit post Reply with quote


@sst13, Thank you, I'm sure it will help! :) I managed to do everything except "changing the map or clampmap key" in the morning. Yes, I use 2 similar textures/shaders - that one and sfx/spawn_floor. Didn't think that they may conflict. :shrug:

I light very differently these days, much more optimized than when I was younger I feel
I'm just nothing (take #2) :miffed: :D




Top
                 
Quake3World.com | Forum Index | Level Editing & Modeling


Post new topic Reply to topic


cron
Quake3World.com
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group