Tree Model Shadow Problem (See Images)


(MidgetKiller) #1

Hey guys,

Although I’ve read many topics on this forum… this is my first post. I need some help. I’m nearing the release date for my map… and everything is coming along great. And the lighting is perfect… except for one thing. I can’t get the tree models in my map to display shadows very well. I have tried both 2.5.13 and 2.5.14 of q3map2, as well as just about every concevable combination of light settings in Q3Map2Build.

I created a small sample map to show you what I mean with a screenshot. Notice the shadows are all blocky. It appears to be shadowing the whole leaf / brach texture… rather than using the alpha and only casting shadows from the leafs.

http://www.ut-mapdepot.com/bad_shadows.jpg

The wall behind the trees has been func_group’d and has a “_lightmapscale = 0.125” key set on it. I compiled with -fast -filter -bouncegrid -bounce 12 -bouncescale 1.0 -super 2.

I have included also a screenshot done by someone else. They are using the same tree models as I am and are able to achieve the shadows that I want. Look at the shadows cast by the tree on the left, against the wall behind it and on the ground.

http://www.ut-mapdepot.com/good_shadows.jpg

Can someone please help me out?

Thanks,

MidgetKiller


(ratty redemption) #2

have you tried the same sky shader as the other guy?

if the tree shaders have surfaceparm alphashadow then they should work, Im not sure why they arent for you, but someone here should be able to help.


(MidgetKiller) #3

Here’s what the shader looks like for the tree model I’m using:

models/mapobjects/GR_trees/tree
{
	surfaceparm alphashadow
	surfaceparm trans
	cull none
	nopicmip

	{
		map models/mapobjects/GR_trees/tree.tga
		alphaFunc GE128
		depthWrite
		rgbGen vertex
	}
}

(ydnar) #4

Remove -filter from your commandline and replace with -samples 2.

The -filter is blurring the shadows away.

y


(chavo_one) #5

If he uses -samples 2, shouldn’t he also remove the -super 2 part as well? I’ve always had the thought that you should never use samples and super together.


(rgoer) #6

You pretty much shouldn’t use -super period. It’s doing a whole lot of time-consuming work for (IMHO) relatively little gain. If you really want to invest compile time into something, invest it into putting -samplesize 4 into the bsp phase of your compile. Takes about the same time as -super does, but is actually worth it.


(QESTUDENT) #7

Remove surfaceparm trans from your shader script.
alphashadow (and lightfilter) automatically set it.


(MidgetKiller) #8

I managed to get in contact with the gentlemen who made the map in the second screenshot above. He told me that my problem lies with the shader file for the trees, not in the methods that I’m compiling the map. He told me that the original shader wasn’t setup properly to cast shadows like I wanted, and also told me that he had an already modified (fixed) shader. I used his shader and all worked well.

Thanks guys for the help I received anyways. Really appreciated it!

MidgetKiller


(ratty redemption) #9

cool and thanx for tell us how you got it working… could you post the fixed tree shader so we can compare it to the old one?


(MidgetKiller) #10

I have posted the fixed shader on my site forums:

http://www.ut-mapdepot.com/forum_viewtopic.php?10.85


(ratty redemption) #11

thanx for the link, but the first tree shader in your forum post appears the same as the one in this forum? …was that the tree you had problems with? …maybe there was a shader conflict with another model using the same name?


(MidgetKiller) #12

There is only one model… but two shaders for this model. The original shader was called “GR_Tree.shader”. When I take that shader out of my shaderlist.txt and add the new shader “zzzut_golgotha2.shader” to my shaderlist, it works. Both shaders reference the same model, however only the second one has the correct blending setup to allow shadows from the leafs and not from the whole texture.


(|NV|S) #13

Midgetkiller, they gave some good suggstions to you about compiling options, especially YDNAR. Here is something that wasnt said that helped me get class A shadows in ut_crenshaw. Check the surface in which the shadows are going to be cast and make those brushes func_group and ramp up the _lightmapscale on them. This gives more detailed shadows on the brushes on which the shadow is cast. the BLOB SHADOWS you are getting on your wall are a combination of compile options and low lightmapscale on the brush. Give it a try.


(the_hat) #14

i beleave the misc_model cant be func_grouped, or this would have been suggested


(ratty redemption) #15

@MidgetKiller, k but it says on your page you linked to

I have included the updated shader information below for your convenience.

but that appears to be the original non working GR_Tree.shader and not the fixed zzzut_golgotha2.shader?

also doesnt the actual misc_model still point to the original shader, or have you changed its paths?

obviously you now have this working, I`m just a little confused how exactly, and I would still like to see the fixed shader :slight_smile:

edit:

@|NV|S, he mentioned in his first post he`d already done this.

@the_hat, they mean func_group the worldspawn brushes which the trees cast shadows onto, not the actual trees, which your right can`t be func_grouped.


(the_hat) #16

ahh yeah, hehe woops.