Tremulous Forum

Mods => Modding Center => Topic started by: MechWarrior001 on July 31, 2010, 08:26:07 pm

Title: Soft Shadows and Self-Shadowing for first person viewpoints
Post by: MechWarrior001 on July 31, 2010, 08:26:07 pm
Is it possible to add soft shadows and self-shadowing for weapons in Tremulous? Or would the shadowing techniques need to be entirely rewritten?
Title: Re: Soft Shadows and Self-Shadowing for first person viewpoints
Post by: Crava_Loft on August 01, 2010, 01:37:13 am
[deleted]
Title: Re: Soft Shadows and Self-Shadowing for first person viewpoints
Post by: gimhael on August 01, 2010, 07:56:42 am
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.
Title: Re: Soft Shadows and Self-Shadowing for first person viewpoints
Post by: MechWarrior001 on August 01, 2010, 04:01:34 pm
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?
Title: Re: Soft Shadows and Self-Shadowing for first person viewpoints
Post by: David on August 01, 2010, 04:06:19 pm
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.
Title: Re: Soft Shadows and Self-Shadowing for first person viewpoints
Post by: MechWarrior001 on August 02, 2010, 05:23:46 am
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?
Title: Re: Soft Shadows and Self-Shadowing for first person viewpoints
Post by: Aelita on August 02, 2010, 05:29:49 am
http://zerowing.idsoftware.com/
Title: Re: Soft Shadows and Self-Shadowing for first person viewpoints
Post by: gimhael on August 02, 2010, 06:20:41 am
Actually the map compiler can be instructed to keep the light entities by setting the key _keepLights to 1 in the worldspawn.
Title: Re: Soft Shadows and Self-Shadowing for first person viewpoints
Post by: MechWarrior001 on August 02, 2010, 07:27:55 am
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?
Title: Re: Soft Shadows and Self-Shadowing for first person viewpoints
Post by: Crava_Loft on August 02, 2010, 08:52:40 am
[deleted]
Title: Re: Soft Shadows and Self-Shadowing for first person viewpoints
Post by: your face on August 02, 2010, 06:29:02 pm
warsow sucks.
Title: Re: Soft Shadows and Self-Shadowing for first person viewpoints
Post by: Crava_Loft on August 03, 2010, 02:06:02 am
[deleted]
Title: Re: Soft Shadows and Self-Shadowing for first person viewpoints
Post by: Odin on August 03, 2010, 08:36:39 am
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.
Title: Re: Soft Shadows and Self-Shadowing for first person viewpoints
Post by: MechWarrior001 on August 17, 2010, 03:12:55 am
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?
Title: Re: Soft Shadows and Self-Shadowing for first person viewpoints
Post by: sheridanm962 on September 16, 2010, 11:56:16 pm
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 :/