Making an Invisible Brush that casts shadow


(denizsi) #1

this time I haven’t made a search in any of the forums, so I’m sorry if this has been asked before…

The thing is, there are a few small places with a web-tent over but they just look bad with no change in light, so I made a few thin brushes and now they look good but this time the brushes… so, is it possible to make invisible brushes which cast shadow?


(SCDS_reyalP) #2

You could make the web tent itself cast shadow, probably by making a custom shader. If it is made out of patches, be sure that you compile with -patchshadows

You can make a shader that is invisible but casts shadows, something like this:


// cast shadows without showing up or clipping. Can be detail. Contributes
// to r_speeds. Other faces should be nodrawnonsolid. Note that this shader
// must be included with the final map, or your users will see holodeck.
textures/blah/shadowcast
{
	q3map_bounce 0.0
	qer_trans .5
	surfaceparm nonsolid
	surfaceparm nolightmap
	{
		map $whiteimage
		alphaFunc GT0
		alphaGen const 0
	}
} 


For it so show up in the editor, you would need an image named textures/blah/shadowcast as well.

It seems like there should be a more efficient way of doing this (one that doesn’t contribute to r_speeds) but if there is, I don’t know what it is.

Ydnar ?


(evillair) #3

surfaceparm alphashadow should make it cast shadows, problem is that the shadows cast won’t look that good (shadows won’t be sharp).

Depending on how it’s set up, you could make a decal texture with the ‘shadows’ and apply that underneat the patch mesh on the ground to make it look like it has nice shadows.

With the warefare engine I’d just use a projector and cast a shadow texture on the ground and it would bend to the surface and also ‘cast’ on the player. But this is q3. :stuck_out_tongue_winking_eye:


(SCDS_reyalP) #4

You can increase the lightmap resolution on the things you want it to cast shadows on. func_group with _lightmapscale < 1


(denizsi) #5

Depending on how it’s set up, you could make a decal texture with the ‘shadows’ and apply that underneat the patch mesh on the ground to make it look like it has nice shadows.

I’ve thought of doing this actually, it is how I used to do it back when I was mapping for Build Engine games. Excluding SW: Jedi Knight, I haven’t been into mapping since that time :slight_smile:

It’s good that I also learned of increasing lightmap res. on things I want. Thanks to all of you


(evillair) #6

[quote=“denizsi”]

It’s good that I also learned of increasing lightmap res. on things I want. Thanks to all of you

Unless your shadows fall on terrain. Then that will require a huge @!9 lightmap. :eek3: