texture lightmap and content questions


(Gate) #1

ok… i’ve got a couple actually, but they all seem to tie directly together.

i have a test map where i’m building prefab modules for an underground map (hallways, intersections, etc etc) i went to do a test compile to make sure all the sections look ok, and it ends up looking reeeally weird.

all the sections are built very tidy… caulk hulls, detail nodraw interior with textured visible faces, zero overdraw anywhere.

if the content of a brush is set arbitrariliy by radiant/q3map2 what would be the best way of maintaining working content properties without creating a large batch of custom nodraw tex’s with the texture properties (like metalsteps, bullet penetrability etc)?

also, would that affect how q3 lights the world?

example:

1st shot:
q3 with no light ent’s, no light compile (full bright)
http://www.was-bored.com/public/alpha_map/shot0002.jpg
r_lightmap 1
http://www.was-bored.com/public/alpha_map/shot0003.jpg

q3 with 1 light ent
http://www.was-bored.com/public/alpha_map/shot0004.jpg
r_lightmap 1
http://www.was-bored.com/public/alpha_map/shot0005.jpg

the center strip is showing hom in one section, while the walls and ceiling are fullbright… even though they are outside the light radius…

center strip shader


textures/nsq3_underground/metal_floor1_underground
{
    qer_editorimage textures/nsq3_metal/metal_floor1.jpg
    surfaceparm metalsteps
    {
          map $lightmap
          rgbGen identity
     }
     {
           map textures/nsq3_metal/metal_floor1.jpg
     }
}

side question: is it preferable to have the lightstage before or after the texture stage?
i’m getting differing opinions on that : /

shader is for Quake 3 Mod

thank you for your time.

  • Robert

($NulL) #2

You need to blend the texture over the lightmap with blendfunc filter.


(ydnar) #3

First of all, your shader needs a blendFunc, like $NulL said.

Secondly, even though you’re using JPG images, shaders like to reference TGA images. It will find the JPG if the TGA isn’t found.


textures/nsq3_underground/metal_floor1_underground
{
    qer_editorimage textures/nsq3_metal/metal_floor1.tga
    surfaceparm metalsteps
    {
          map $lightmap
          rgbGen identity
     }
     {
           map textures/nsq3_metal/metal_floor1.tga
           blendFunc GL_DST_COLOR GL_ZERO
     }
}

But since your shader isn’t using anything special, you can use a compiler-only shader and let Quake 3 generate the stages implicitly. The following shader will only be loaded by Q3Map2, and thus only needs Q3Map2-relevant sections, like the surfaceparm:


textures/nsq3_underground/metal_floor1_underground:q3map
{
    surfaceparm metalsteps
}

This of course, assumes that you are using an image “textures/nsq3_underground/metal_floor1_underground.tga” (or jpg). Note that this is overkill to have “underground” twice in the texture path. It might as well be named “textures/nsq3_underground/metal_floor1.tga”.

If you don’t want to duplicate images, and that texture ships with NSQ3 by default, you can use a remap (a feature in recent Q3Map2 builds):

textures/nsq3_underground/metal_floor1_underground
{
qer_editorimage textures/nsq3_metal/metal_floor1.tga
q3map_remapShader textures/nsq3_metal/metal_floor1
surfaceparm metalsteps
}



That shader will set the metalsteps parameter and remap the [i]named[/i] shader in the BSP to the plain-jane texture (or whatever ships with NSQ3).

Hope this helps.

y

(Gate) #4

(thanks for the tip on the remap feature : D )

i’ve patched up the shaders i’m using with the blendfunc’s, but that really didn’t do anything visibly… i’m guessing the underlying problem is how the brush content is tied to face 1. and in most cases face 1 will be a nodraw. so can i modify the nodraw to accept a lightmap and preserve content properties (like metal steps, etc) without creating several new nodraw shaders with individual content properies?

sidenote: i was under the impression that having a shader with a duplicate name as one that already existed could cause conflicts? does the folder path change that, or did the rules change altogether?

sidenote2: so lightmap first is the prefered order?

there is probably something else i’m forgetting to ask, but my brain hasn’t quite booted up this morning.


(ydnar) #5

You’re not creating any duplicate shaders.

If you want, you can create nodraw_metalsteps and duplicate the existing nodraw shader.

Incidentally, why are you using nodraw instead of caulk on the backsides of those opaque/solid brushes?

y


(Gate) #6

the only shader differences i saw between caulk and nodraw was the trans/nomarks flags, so i picked nodraw as the backfacing on the detail work… it allows me to filter the caulk hull out and still be able to see all the inner detail work.

so creating new nodraw shaders is my only resort? i have several differnent sets of surface properties : (

i’ve seen posts talking about including a feature into q3map2 that would cause brushes with differing content properties to have the properties of the most important face… are there any plans to incorporate such a feature? if so i’ll hold off on beta testing til then : )

btw, is the nodraw (trans flag) causing the textured faces to be fullbright rather than vertex/lightmap lit?

construction demo:
http://www.was-bored.com/public/alpha_map/construction.jpg


(ratty redemption) #7

in case you didnt know, trans doesnt block light, so it could be why your rooms aren`t lighting properly.


(ydnar) #8

You should always use caulk on the backsides of solid/opaque brushes, for numerous reasons including lighting.

If you want, a few people have made a “detail_caulk” shader which is identical to caulk, except has “surfaceparm detail” and is blue instead of pink, allowing you to filter it out.

To recap, nodraw is for the backsides of translucent/masked/non-opaque or nonsolid brushes.

Incidentally, nomarks has no effect if the shader is already nodraw–the latter means “don’t make a visible surface” and the former means “don’t draw marks on the visible surface” (of which there is none).

y


(Mr_Tickles) #9

Uh oh, does that mean that with all the detail brushes i’ve made, with caulk on the appropriate faces that they could suffer from the content parms problem and a reasonable proportion of them will switch between detail and structural during consecutive compiles?


(SCDS_reyalP) #10

no. Caulk brushes set to detail in the editor behave correctly.


(ratty redemption) #11

do you guys want to post a link to a detail_caulk shader and editor image? I could make one and post a link to it if anyone wanted this? …but if there are ones already online, then people might as well use those.


(Mr_Tickles) #12

Thanks SCDS_reyalP :slight_smile:
Sounds cool Ratty, but I think i’ll stick with normal Caulk for the time being as I can’t see much of a difference between the two.


(ratty redemption) #13

yeah I dont normally use detail caulk myself, but might use it again oneday... its just nice to know we can do that if needed :slight_smile: