no lightmap stage..


(Lil Killa) #1

OK i checked out the Q3 shader manual and couldn’t find anything on this error I’m gtting in game…

Error:

WARNING: shader ‘textures/cath/lamp’ has lightmap but no lightmap stage!

Extra:

Here is the shader file I am currently using:

textures/cath/lamp
{
surfaceparm alphashadow
surfaceparm trans
nopicmip
qer_editorimage textures/cath/lamp.tga
qer_lightimage textures/cath/lamp.tga
{
map textures/cath/lamp.tga
alphafunc GE128
depthwrite
rgbgen exactVertex
}

}

My textures folder is cath and my tga file is called lamp so I don’t think it is a path problem. I am stumped as to what could be the sollution and any help would be appreciated.


(Hewster) #2

Hi,

Try adding “surfaceparm pointlight” or “surfaceparm nolightmap”

Both (as I understand it) will stop lightmaps being calculated on the
surface, I believe that “surfaceparm pointlight” is the prefered method.

Hewster


(Lil Killa) #3

I think my problem may be more with radiant… I’m going to do a few tests to see if my “hunch” is tru or not… If it still doesn’t ork then I will try your solution :cool:


(Lil Killa) #4

OK I tried both surface parms seperatly and neither one worked…

The purpose of this shader is to make an effect like the lamps used in Estatica by Cardigan: Estatica I have heard that the method used for the lighting to make the shadows crisp/sharp is what makes the map a bit laggy… If that is true then could someone atleast point me into the right direction as how I might acheive a similar effect without a significant performance hit? I have been searching around for solutions but can’t seem to find anything… Thank you for your help thus far.


(The5thHorsemen) #5

I think your talking about lightmap sample scale as far as the detail shadows goes.

there are many threads already explaning lightmapsacle already writen so I will not go into it here just run a site search for lightmapscale .

_lightmapscale


(ydnar) #6

Like Hewster said, add one of these to the shader:

surfaceparm pointlight
surfaceparm nolightmap

Alternatively, you could add a lightmap stage after the texture stage:

{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
depthFunc equal
}

y


(Lil Killa) #7

OK I could only get the lightmap stage to work and the problem is now gone. I now have another problem…

I am trying to get the lamp to cast a shadow from the inside out (ie. have a box with this shader applied and have a light inside and have it cast shows along the wall…

I have a tga file with an alpha channel in the correct place. The image is transparant in the right places but I can’t get it to cast shadows. I have tryed everything I know how to do and I did a search on the forums and didn’t see anything on the subject…

Could someone point out wait I am doing wrong or need to do?


(The5thHorsemen) #8

q3map_alphashadow


(Lil Killa) #9

If I already have a " surfaceparm alphashadow " in my shade do I replace it with ne line or add it under it?

Sorry if I sound like a noob because I am… I’m trying to learn this shader stuff but I must say I’m finding it a bit dificult…

Thank ou for your help so far though :smiley:

EDIT:

Thought having my shader here would help…

textures/cath/lamp
{
    surfaceparm alphashadow
    surfaceparm trans
    nopicmip
    qer_editorimage textures/cath/lamp.tga
	
                          {
		map textures/cath/lamp.tga
		alphafunc GE128
		depthwrite
		rgbgen exactVertex
	             }

	{ 
	map $lightmap 
	blendFunc GL_DST_COLOR GL_ZERO 
	depthFunc equal 
	} 

}

(ratty redemption) #10

your using an alphafunc of GE128, which I think will only work if your alpha channel contains a “foreground” color greater or equal to 128, if the white or gray pixels are less then 128 in the 256 grayscale index, then they will be treated as “background” color, ie black or 0.

you could try alphafunc with LT128 or GT0, which stand for less than 128 or greater then 0.

and if you want a smooth edge to your alpha channel, use a blur type filter on it in your paint program, then replace the alphafunc with blendfunc blend, although that can impact on fr.


(ydnar) #11

Models don’t have lightmaps unless you specifically set them up to be that way.

Nuke the lightmap stage and add rgbGen vertex to the texture stage.

y


(ratty redemption) #12

ydnar, Ive been trying to do a search on exactvertex, but I couldnt find an explanation of it, could you explain what it does, or give examples of when and when not to use it?


(ydnar) #13

exactVertex uses the unmodulated vertex color (no overbright bitshifting). It also sets the alpha component to 255.

y


(Lil Killa) #14

I’m not ussing a model…

Anyway if that were to not matter… Also I don’t know what the texture stage is…

oi I need to go back and read the manual…


(ratty redemption) #15

ydnar, thanx and I think I understand that.

Lil Killa, the tex stage is this section of your shader…

{
map textures/cath/lamp.tga
alphafunc GE128
depthwrite
rgbgen exactVertex
}

so, I think ydnar is suggesting you change it to…

{
map textures/cath/lamp.tga
alphafunc GE128
depthwrite
rgbgen Vertex
}


(Lil Killa) #16

hmmm I changed it to what you gave me in the example and it still is notcasting a shadow like I want it to…

I think I should start over (please stop me if you think otherwise)

From the begining:

clears throat

I made a simple little texture a patch or brush (ussing a path at the moment) that has a clear area specified by an alpha channel and a nonclear spot. I would like to place a light in a room with this texture on a patch or fixed up with brushes so that the texture surrounds the light like a lamp. Then I want the light to act as if the “nonclear” parts of the shader where a brush so that they will cast shaows in the map.

In short I want to make a shader so that the solid (nonclear) part of my tga block light and the nonsolid(clear) parts allow light through as they are clear glass.

Example:

Estatica

I have been trying to make a shader to make an effect similar to his but I can’t figure it out. I have gone so far as to copy the shader and texture to make a lamp for a test map just to test the concept and I can’t get that to work…

I think I am doing something wrong that has a simple solution but I can’t quite figure it out. I’m going to try to use a brush instead of the patch i have been using but I don’t thing it will make much of a difference.

If someone could point me in the right direction now that I have completely explain what i am trying to do I would be the happiest person on earth (well maybe not the happiest… but I would probably worship the ground the ground you walk on :cool: )


(ratty redemption) #17

personally I understood the effect you were after, but without trying this myself I probably can`t help you any further, other then suggesting you do try a brush with this tex on and nodraw on the other faces and try out this version of the shader you posted earlier.

textures/cath/lamp 
{ 
    qer_editorimage textures/cath/lamp.tga
    surfaceparm alphashadow
    surfaceparm nolightmap
    surfaceparm nomarks
    surfaceparm trans
    qer_trans 0.95
    cull disable
    nocompress
    nomipmaps
    nopicmip     
   { 
      map textures/cath/lamp.tga 
      alphafunc ge128 
      depthwrite 
      rgbgen vertex 
   } 
}

if you get the effect how you want, please tell us how you did it.


(Lil Killa) #18

OK an update…

The line “nocompress” created an eror in-game that made the textures not show up so I took it out and I am one step closer to my goal.

Finnaly the shader displayes the texture on both sides of the face you apply it to. (wasn’t doing this before) but I still have no shadows… I tryed ussing a brush with nodraw on all faces but one but it just blocked all light likr a normal brush would…

I have everything working the way I want it besides the shadows…

I’ll try a bit of tweaking tommorow when I have more time unless someone replies here before I get home…


(ydnar) #19

Make sure your shader is listed in shaderlist.txt.

y


(ratty redemption) #20

sorry about the nocompress, tbh, I cut n paste that from an old shader of mine and I cant remember what that keyword is ment to do, although in wolf it doesnt seem to fook up anything.

but I usually only keep keys, values in my shaders that I think I know what they do, as it`s easier to debug them.

the cull disable is the one that allows you to see your tex on both sides of the brush face in game.

and if you using the common/nodraw shader then that should have a trans property, which shouldn`t block any light.

you could try a test by painting the whole of your brush with common/nodraw and seeing it that is blocking any light, Im guessing it wont, which would suggest your visible shader is still blocking all light and not allowing light through the alpha channel.

you could also try deleting or disabling the line surfaceparm nolightmap with // before the first word in that line.

also, you might get better results by replacing the alphafunc line with blendfunc blend.