Light map & fullbright - how to achieve uniformity?


(HairyPlums) #1

Hello all,

I am doing a small mapping project and have run into a problem that seems to have been discussed on & off on those forums - but I can’t find a clearly laid out solution, so I’ve chanced a new topic…

This is RtCW.

I’m designing my map using all the lovely Q3Map2 effects (lightmapped terrain, phong, etc) but am running into this problem:

  • [li]When fullbright (vertex) lighting is selected, some of the textures go “fullbright” but others do not.

[/li]
I’ve isolated this to:

[ul][li]Textures without shader scripts always maintain the lightmap, even in so-called vertex mode i.e. plain .jpg/.tga files
[/li]
[li]Textures with shader scripts always go fullbright[/ul]
[/li]
What I am trying to achieve is uniformity in both light-mapped & vertex modes (i.e. when in vertex mode all the textures look like they have the same lighting!). I think that I could write a shader for every texture , and thus have them all go fullbright in vertex mode - except for the terrain…which always seems to keep it’s lightmap.

I suspect this is fairly simple, but as I’m just getting into the swing of this, I suspect there are a few basics I am missing - being too keen to get to the goodies without fully understand ing the basics :(.

Hope this makes sense, thanks in advance…

Aside: a biiig thank you to goes to Hummer for allowing Battlefield Europe reverse some of his maps :slight_smile: :slight_smile:

A Merry Xmas & a Guid Hogmanay tae ye all frae Scotland!


(Gringo Starr) #2

I didn’t figure this out on my own, but here is what I use. The only reason I used the following shader was to get “surfaceparm woodsteps”, so it may not solve all your problems. What you HAVE to do is, compile with this shader, then remove it from the .shader file when running the map. It should look good in lightmap and vertex then.


textures/ww_beach/ma_barnwood4
{
qer_editorimage textures/ww_beach/ma_barnwood4.tga
surfaceparm woodsteps
q3map_lightmapsamplesize 18
//q3map_lightmapGamma 4
{
map $lightmap
rgbGen identity
}
{
map textures/ww_beach/ma_barnwood4.tga
blendFunc filter
rgbGen identity
}
}

(HairyPlums) #3

Thanks Gringo!

Just to be sure I understand that - you’re saying I should remove the shader in question from any distributed PK3 file that I create i.e. maintain 2 copies of the shader, one for compiling & one for the public?

TY for the help…


(Gringo Starr) #4

Yep, that’s right. But did you test it already? Before thanking me, see if it works for ya! :slight_smile: lol You’re welcome.


(HairyPlums) #5

Gotcha… :rocker: but that’s for tomorrow, as it’s 11.30pm & I’m 6 Old Speckled Hen’s up :stuck_out_tongue:


(ydnar) #6

There are two more ways around this. If it’s just a “woodsteps” shader, then you can add :q3map to the name of the shader and the game will ignore it.

textures/yourmap/somewood

to

textures/yourmap/somewood:q3map

This is an alternative to deleting shaders after compiling. You only need to put the “surfaceparm woodsteps” line into the shader as the in-game parts will be ignored.

Your other option is to put a vertexremapshader into worldspawn:

“vertexremapshader1” “textures/yourmap/somewood;textures/yourmap/somewood_vx”

Where 1 is some arbitrary number, and the _vx shader uses rgbGen vertex instead of a lightmap pass.

y


(HairyPlums) #7

Wheeeee!

100% working & looking good now…thanks ydnar!


(ratty redemption) #8

HairyPlums, which method did you use in the end?


(HairyPlums) #9

I used the vertexremapshader method ydnar recommended to ensure terrain in vertex mode would not be shadowed (substituted each lightmapped terrain shader with the same simple rgbGen vertex shader i.e. all terrain is now a uniform grass in vertex mode rather than my lovely grass/sand blend).

I also just wrote a shader script for every texture in use, so they all go fullbright in vertex mode now. I can live with that…plus it’s nice to select “shaderlist.txt only” and have it filter out all shaders that I’m not using **.

**I’m now using a separate shaderlist.txt file for each of my maps (simple renaming) so the Radiant environment is nice & clean :smiley:


(ratty redemption) #10

thanx and good tip for the shaderlist.txt

Ive usually commented out // any shader files I didnt want the list to show in gtk, but that is slower then simply renaming the shaderlist file(s) cool :slight_smile:


(HairyPlums) #11

I use a couple of batch file to start GtkRadiant, and have shortcuts to them on my desktop to do the appropiate deleteing/copying. It does the renameing for me & fires up Radiant e.g. for my Brandenburg Gate map I have:


cd C:\Program Files\Return to Castle Wolfenstein\Main\scripts
del shaderlist.txt 
copy shaderlist_brand.txt shaderlist.txt
C:\Program Files\GtkRadiant-1.4\GtkRadiant-1.4.0-rc2.exe

Hope this is of some use :slight_smile:


(ratty redemption) #12

cool and that`s even better then manually swapping the shaderlists :slight_smile:

I already use batch files for copying my radiant.ini and .qe4 files, but didn`t think of using it with the shaderlists.

edit: in your batch file, do you really need the del if your then copying your “backup” file over the “current” version?


(HairyPlums) #13

Glad to help :stuck_out_tongue:

You can do without deleting the current version if you use the /y switch on the copy command i.e.


copy /y shaderlist_brand.txt shaderlist.txt

This suppresses the overwriting prompt that you would get - I just like to be explicit and delete the current one…


(ratty redemption) #14

thanx, but what os are you using?

cus in 98se my batch files dont promt when overwriting files, although that would be useful... heres the one I run from my wolf\radiant 1213 folder


@echo off
echo.
copy ratty.ini radiant.ini
copy ratty.qe4 radiant.qe4
"c:\program files\gtkradiant 1213\gtkradiant_1213.exe"

(HairyPlums) #15

I’m using spits Windows XP ATM - I’d prefer a Linux box, but you don’t turn your nose up at a free Dell dual-Xeon from your work for “working at home” :D…

I seem to recall that older DOS’s do have a verification switch, open a DOS box & do a copy /? to see the parameters.


(ratty redemption) #16

ah, I totally forgot about the dos /? help switch…

-Y Causes prompting to confirm you want to overwrite an existing destination file.

thanx :slight_smile: