Textureshadows do not work properly

I made a cheap tree model, consisting out of flat elements, which refuses to cast Textureshadows correctly.
-The modelname and -path is /models/Tree1final.mdl
-The lights.rad contains “forcetextureshadow Tree1final.mdl”
-$light.exe is running “-staticproppolys -staticproplighting -textureshadows -bounce 2 -noextra -game $gamedir $path$file”
-The model has a lod-model and an extra collision-model, because it’s not solid.

Does anyone know how to achieve working Textureshadows on for foliage?

https://dl.dropbox.com/u/36498915/Textureshadowproblem.PNG

Not entirely sure here, however, try “forcetextureshadow models/Tree1final.mdl” (You may be using an incorrect path way to the model)

The alpha channels of the material files should be detected and used to create lightmap shadows for that model.

Also, double-check the lightmap scaling on the ground brush and see if it’s at least 16.

Does the tree material have the right flags and VMT settings?

I may be wrong but doesn’t the model need to be compiled with $mostlyopaque or something like that?

The code of the .vmt for the model is



"vertexlitgeneric"
{
	"$basetexture" "nature/cbtrees/tree1"
	"$alphatest" 1
	"$nocull" 1
}




What special flags does the vtf need?

Lightmaps are okay, path seems to be too.

Something else (I probably should have mentioned this before). I made the model using Propper. Is there something to consider during compiling the model?

Whats the full path to the tree model

\half-life 2\hl2\models ree1final.mdl

I put it directly into \models, because I was suspecting the problem to be caused by the folder-layout…

I also tried “forcetextureshadow models/tree1final” in the Lights.rad, same result :confused:

Try $translucent instead of $alphatest.

Doesn’t change anything, except for the weird depth-sorting of the layers :confused:

add .mdl to the end of the file name.
like this
forcetextureshadow props_foliage/urban_tree_giant01_small.mdl

If Firegod’s fix deosn’t work, check your compile log for this:

[editline]29th August 2012[/editline]

Btw, change ignore surface normal to yes in hammer to fix the prop’s lighting.

I have, but it doesn’t fix it :confused:

No “unexpected strips found” either

But I noticed something weird in the compilelog:



...
ThreadComputeLeafAmbient: 0...1...2...3...4...5...6...7...8...9...10 (3)
Writing leaf ambient...done
Computing static prop lighting : 0ThreadComputeStaticPropLighting: 0...1...2...3...4...5...6...7...8...9...10 (0)

Ready to Finish
...


“Computing static prop lighting” seems to be interrupted without giving out an error.
Does anyone have an idea what this means?

take out -bounce 2 and -noextra (from the expert compile log) see if that fixes it

Nope, still nothing :confused:
I compiled it along with a downloaded model, which had texture-shadows. Also, I compared the .vmt’s of the working and a not working model and the vmt’s are the same. (Even though, the downloaded model had no entry in the lights.rad-how can that be?)

The problem must be the model itself or the original .vtf

What are the differences between the VTF flags?

A full list of them can be found here:

Except for the “Eight Bit Alpha”-flag I really doubt, that they can cause/ solve such a problem.
Just to be sure I’ll compare the flags of the working textures…

A quick and easy work-around would be to make the model a prop_dynamic in Hammer, so that it casts dynamic shadows instead of lightmap shadows. Dynamic shadows will achieve what you are attempting to do (which is having the light pass through the leaf texture and create individual leaf shadows). It isn’t really much more expensive despite what people will tell you and if you are only going to be placing a handful of these models in your map, then it’s a no-brainer.

let me know if you need any help,

Well, I kind of solved the issue^^
I compiled all the models directly in /models and used for all folders and names of models and materials only lowercase letters (Lights.rad seems to have a weird sense of case-sensitivity).
I have no still idea why, but it solved my problem, the textureshadows work correctly now.

Thank you guys so much for the support and the suggestions, you rock! :smiley:

I included a little showcase, to show you the actual look of the foliage-models in my map. Enjoy :wink:

nice looking village. is this an RP map?

Well, since it’s for Gmod, I’ll just make it a gm_-map, but I’ll leave it completely open, so it can basically be used for everything.
If I still have ressources left on completing it, I’ll make as many buildings enterable as possible.

I’ll also make a night-setting ZS-map from it, but that’ll probably still take some time^^
You can always keep track of the project on my website http://timrichter.de/