News:

Come Chat with us live! Learn how HERE!

Main Menu

Soft Shadows and Self-Shadowing for first person viewpoints

Started by MechWarrior001, July 31, 2010, 08:26:07 PM

MechWarrior001

Is it possible to add soft shadows and self-shadowing for weapons in Tremulous? Or would the shadowing techniques need to be entirely rewritten?

Crava_Loft

[deleted]

gimhael

The Tremulous BSPs don't contain the positions of the light sources. They are discarded after the map compiler computed the light maps. Without this data you cannot render (realistic) shadows.

MechWarrior001

So I would have to modify the BSP compiler to retain the light source positions during compilation and modify Trem to use those during shadow calculation, correct?

David

Yep.
There's already some lighting info in the entities, it would probably make sense to add whatever else is needed there too, as you'll want different (simpler) lighting for ingame.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

MechWarrior001

#5
alright, so where can I find the source code to GTKRadiant & the BSP compiler for Tremulous? And uh, which files control whether the light source info is discarded during compilation or not?


gimhael

Actually the map compiler can be instructed to keep the light entities by setting the key _keepLights to 1 in the worldspawn.

MechWarrior001

Hmm, if that's the case it seems the best bet would be to have the renderer check for "_keepLights 1" upon bsp initialization. If it returns negative, then it reverts back to the older techniques used by cg_shadows 2 or cg_shadows 3. If it returns positive, then it will use the newer techniques to Sos & Ses the FP weapons & 3rd person models, along with using separate commands like "cg_softshadowintensity" to control how fine or soft the shadows are, and "cg_fpselfshadowing", "cg_softshadowing" & "cg_fpsoftshadowing" to individually control which shadowing techniques are active, either for performance or user preference.

What are you ideas for this?

Crava_Loft

[deleted]

your face

Quote from: dolby on February 19, 2003, 06:44:44 PM
spam spam spam, waste waste waste!

Crava_Loft

#11
[deleted]

Odin

You don't need to fiddle with the map compiler. You can just guess the light positions based on the lightgrid... Or, hell, use the lightgrid as your source of lighting.

MechWarrior001

Then shouldn't I be able to just have the shadows softened without having the rendering mechanics modified? And what about self-shadowing for fp weapons and models? Shouldn't I be able to use the lightgrid for that aswell?

sheridanm962

I wonder when cg_shadows 4 will come out (more realistic shadows with no lag and actually does a proper job of rendering) because it's a fucking pain in the ass when you have the gay blob after you :/