q3map_surfacemodel ... no shadows!!


(k.deX) #1

hello all…

i have been making a few maps for vq3a for my clan of late and i have struck a bit of a problem with surfacemodels on my large outdoor/islands map. they don’t seem to be casting shadows onto the terrain…

i searched everywhere and found nothing on this topic, so i decided to post here in case one of the true masters of this art can help me out :slight_smile:

my terrain shader works nicely, its an alphamap style terrain (i had to make my own common/terrain shader to get my palm tree models to cast shadows onto it… that seemed a bit weird) but now im having the same problem with the ferns (which are placed on the terrain with q3map_surfacemodel). the palm trees are just misc_model’s placed in the map and they cast shadows perfectly.

the only thing i thought might be causing this is surfaceparm trans in the fern’s shader… does that make it not cast shadows? i guess i could leave it out. the map takes too darn long to compile with lighting to be doing trial and error stuff… i want to get it right first time!

thanks for reading
k.deX


(k.deX) #2

awesome
i removed the surfaceparm trans line, waited an hour or so for compile, and now shadows are cast from the models. :smiley:

but they still dont appear to be receiving shadows… looks a bit strange when a fern is in shadow and its fullbright…

#edit ok compile time was only a half hour… bleh, sue me


(k.deX) #3

k, its fixed… seems there was a problem with my fern shader. i read a post by ydnar in some forum saying that shaders shouldnt be used for surfacemodels… but i needed the shader to make the fern transparency work. this is the shader that worked:

models/mapobjects/seaquel/fern
{
surfaceparm alphashadow
cull disable
{
map models/mapobjects/seaquel/fern.tga
rgbGen vertex
depthWrite
alphaFunc GE128
}
}

i thought it was a bit strange that a shader without a lightmap pass actually got lightmapped, and with the lightmap pass in there it wasnt lightmapped (well not properly anyway)

i hope this can be helpful to someone someday, it wasted a good few hours of my useless time figuring out how to get it happening properly.

no further questions.


(obsidian) #4

In the shader above, your fern model is not being lightmapped at all - it is vertex lit - which is better than if it were lightmapped anyway.

-Small models should probably not be lightmapped at all since it reduces performance.
-Models with relatively small polygon subdivisions will usually look better vertex lit than lightmapped.