Author Topic: Soft Shadows and Self-Shadowing for first person viewpoints  (Read 7132 times)

MechWarrior001

  • Posts: 58
  • Turrets: +3/-3
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

  • Guest
Re: Soft Shadows and Self-Shadowing for first person viewpoints
« Reply #1 on: August 01, 2010, 01:37:13 am »
[deleted]
« Last Edit: August 11, 2010, 12:56:26 pm by Crava_Loft »

gimhael

  • Posts: 546
  • Turrets: +70/-16
Re: Soft Shadows and Self-Shadowing for first person viewpoints
« Reply #2 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.

MechWarrior001

  • Posts: 58
  • Turrets: +3/-3
Re: Soft Shadows and Self-Shadowing for first person viewpoints
« Reply #3 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?

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: Soft Shadows and Self-Shadowing for first person viewpoints
« Reply #4 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.
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

  • Posts: 58
  • Turrets: +3/-3
Re: Soft Shadows and Self-Shadowing for first person viewpoints
« Reply #5 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?
« Last Edit: August 02, 2010, 05:27:32 am by MechWarrior001 »

Aelita

  • Posts: 742
  • Turrets: +147/-34

gimhael

  • Posts: 546
  • Turrets: +70/-16
Re: Soft Shadows and Self-Shadowing for first person viewpoints
« Reply #7 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.

MechWarrior001

  • Posts: 58
  • Turrets: +3/-3
Re: Soft Shadows and Self-Shadowing for first person viewpoints
« Reply #8 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?

Crava_Loft

  • Guest
Re: Soft Shadows and Self-Shadowing for first person viewpoints
« Reply #9 on: August 02, 2010, 08:52:40 am »
[deleted]
« Last Edit: August 11, 2010, 12:55:38 pm by Crava_Loft »

your face

  • Community Moderators
  • *
  • Posts: 3843
  • Turrets: +116/-420
Re: Soft Shadows and Self-Shadowing for first person viewpoints
« Reply #10 on: August 02, 2010, 06:29:02 pm »
warsow sucks.
spam spam spam, waste waste waste!

Crava_Loft

  • Guest
Re: Soft Shadows and Self-Shadowing for first person viewpoints
« Reply #11 on: August 03, 2010, 02:06:02 am »
[deleted]
« Last Edit: August 11, 2010, 12:58:00 pm by Crava_Loft »

Odin

  • Spam Killer
  • *
  • Posts: 1767
  • Turrets: +113/-204
    • My Website
Re: Soft Shadows and Self-Shadowing for first person viewpoints
« Reply #12 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.

MechWarrior001

  • Posts: 58
  • Turrets: +3/-3
Re: Soft Shadows and Self-Shadowing for first person viewpoints
« Reply #13 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?

sheridanm962

  • Posts: 163
  • Turrets: +10/-57
Re: Soft Shadows and Self-Shadowing for first person viewpoints
« Reply #14 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 :/