Author Topic: Sunshafts / Crepuscular Rays / Lightshafts (Committed!)  (Read 40075 times)

0 Members and 1 Guest are viewing this topic.

Offline Valathil

  • ...And I would have had a custom title if it wasn't for you meddling kids!
  • 29
  • Custom Title? Wizards need no Custom Title!
Re: Sunshafts / Crepuscular Rays / Lightshafts
that is awesome but i cant imagine how that is because of me must be a thing of the trunk patches recently commited
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Sunshafts / Crepuscular Rays / Lightshafts
The last nightly available is 7938 and it doesn't happen there, so I dunno.
aka, I would test but I can't  :p

On the topic of the godrays themselves. I feel the effect works best when the ships are in the distance. When you're pretty close to a large ship and don't look directly at where the sun is suppose to be, the effect doesn't show up. Until you shift your crosshair like a few meter to the right, then the whole ship lights up. Overal I feel the effect should be a bit more subtle then it currently is.
I'm really loving this effect  :nod:
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Valathil

  • ...And I would have had a custom title if it wasn't for you meddling kids!
  • 29
  • Custom Title? Wizards need no Custom Title!
Re: Sunshafts / Crepuscular Rays / Lightshafts
you know those parameters in post-processing.tbl? play with them until you get a satisfying subtlety.
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 
Re: Sunshafts / Crepuscular Rays / Lightshafts
Just one question. This is a post effect right? Now, I am not a coder, but I have a lot of experience with compositing, and this is what it looks to me you are doing - using an object's silhouette to get its trail and cut that out of the star glare, and the result is than added to the background (first sequence of images I made). That is why shadows disappear once the objects are not in the star's glare. But this shouldn't be like that - the glare is just an optical effect in real life, and volumetric shadows suggest a medium - they should be visible even if the light source is out of the frame. Is it possible to do something like the second sequence - use the star position just to get the object shadow, and then substract that from everything else, so you don't depend on the star glare intensity?

Sorry if I'm off base here, this is how I'd do it if I was making an animation.

[attachment deleted by a basterd]

 

Offline Valathil

  • ...And I would have had a custom title if it wasn't for you meddling kids!
  • 29
  • Custom Title? Wizards need no Custom Title!
Re: Sunshafts / Crepuscular Rays / Lightshafts
i understand what you are trying to say.  first the effect has the big limitation that since it IS a post effect it only has information on the scrren therefore it only works correct when the sun is on screen. secondly the darkening could work and might look good have to try it out
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 
Re: Sunshafts / Crepuscular Rays / Lightshafts
I just post here because i met a little bug yesterday and i do not know if it's acknowledged already or not.

however, I'm at work right now and won't be able to post screenshot to you but i think it's easy to describe.
With that build , when i switch from cockpit view to extrenal view, i still see a sort of ghost of my cockpit... on the external view .

I wish you a good "gaming break" , what you have done with shade rs are amazing, and choosing beetwen light shaft/shadow build is big dilemma :D
On a side note : i did not notice any performance loss in those two builds.
 
(what i mean : Awesome work )
« Last Edit: December 05, 2011, 02:25:34 am by Reprobator »
$Formula: ( every-time
   ( has-time-elapsed "0" )
   ( Do-Nothing
   )
   ( send-message
      "#Dalek"
      "High"
      "Pro-crasti-nate"
   )
   )
)
+Name: Procratination
+Repeat Count: 99999999999
+Interval: 1

 

Offline Valathil

  • ...And I would have had a custom title if it wasn't for you meddling kids!
  • 29
  • Custom Title? Wizards need no Custom Title!
Re: Sunshafts / Crepuscular Rays / Lightshafts
Ok this is commited to trunk. I got a update for the post_processing.tbl though since you can choose how many texture samples you want (more is better quality less color banding)

Code: [Select]
#Effects

$Name: distort noise
$Uniform: noise_amount
$Define: FLAG_DISTORT_NOISE
$AlwaysOn: false
$Default: 0.0
$Div: 20000
$Add: 0

$Name: saturation
$Uniform: saturation
$Define: FLAG_SATURATION
$AlwaysOn: false
$Default: 1.0
$Div: 100
$Add: 0

$Name: contrast
$Uniform: contrast
$Define: FLAG_CONTRAST
$AlwaysOn: false
$Default: 1.0
$Div: 500
$Add: 1

$Name: film grain
$Uniform: film_grain
$Define: FLAG_GRAIN
$AlwaysOn: false
$Default: 0.0
$Div: 100
$Add: 0

$Name: stripes
$Uniform: tv_stripes
$Define: FLAG_STRIPES
$AlwaysOn: false
$Default: 0.0
$Div: 100
$Add: 0

$Name: dithering
$Uniform: dither
$Define: FLAG_DITH
$AlwaysOn: false
$Default: 0.0
$Div: 100
$Add: 0

#Ship Effects

$Name:                Cloak
$Shader Effect:         2
$Disables Rendering:   YES
$Invert timer:         YES

$Name:               Decloak
$Shader Effect:         2
$Disables Rendering:   NO
$Invert timer:         NO

#Light Shafts
$AlwaysOn:      YES
$Density:        0.5
$Falloff:         1.0
$Weight:         0.02
$Intensity:     0.5
$Sample Number: 50

#End

And for the non coder croud here the build

[attachment deleted by a basterd]
« Last Edit: December 08, 2011, 02:59:50 pm by Valathil »
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 

Offline Kolgena

  • 211
Re: Sunshafts / Crepuscular Rays / Lightshafts (Committed!)
I was playing thru the 2nd campaign mission, and noticed that the "anamorphic" sun glare is gone. Is this intentional?

Edit: A bug from your posted build: in ship selection, the tech animation (green grids) for fighters will draw cockpit glass at the very beginning, rather than waiting for the scan line to reach that point first.

Edit2: I apologize for suggesting something after the commit, but I was wondering how feasable it would be to give slices away from the caster gradually less weight? As it is, the "shadow" beam looks uniformly dark and rapidly fades to light at the tail. It could look better with a softer/more drawn out transition, IMO. (Also, is it at all possible to have beams drawn with suns off-screen? I'm guessing no, but thought I'd ask anyways). If you're wondering, this is the first time I've gotten around to trying these sunshafts, and they look fantastic.
« Last Edit: December 10, 2011, 09:37:01 pm by Kolgena »

 

Offline Ransom

  • M. Night Russel
  • 210
  • It will not wait.
    • Rate of Injury
Re: Sunshafts / Crepuscular Rays / Lightshafts (Committed!)
As cool as this effect is, it doesn't make visual sense. Why is it caused by the optical blinding effect of looking at the sun? Presumably the star should be casting rays through the medium of space, not across your eyes.

(Apologies if this has already been raised.)

 

Offline Kolgena

  • 211
Re: Sunshafts / Crepuscular Rays / Lightshafts (Committed!)
Yeah, I have to agree with that. That's why I'd go for view angle-independent crepuscular rays a la Crysis for nebula missions, and no rays (or very very subtle ones) at all in space missions. Then again, it may not be feasible to draw rays when the sun is offscreen.

 

Offline Valathil

  • ...And I would have had a custom title if it wasn't for you meddling kids!
  • 29
  • Custom Title? Wizards need no Custom Title!
Re: Sunshafts / Crepuscular Rays / Lightshafts (Committed!)
As cool as this effect is, it doesn't make visual sense. Why is it caused by the optical blinding effect of looking at the sun? Presumably the star should be casting rays through the medium of space, not across your eyes.

(Apologies if this has already been raised.)

its an APPROXIMATION. Yes the rays SHOULD be cast through the medium and not as a screen space effect. BUT 1. not possible without rendering real shadow volumes ( You dont want that trust me ) and 2. its a pretty close approximation what happens if the rays are coming from the front (as is ON SCREEN).

PROTIP: Don't like it dont turn it on.
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 
Re: Sunshafts / Crepuscular Rays / Lightshafts (Committed!)
And well there is the cool factor that rules everything! :p
$Formula: ( every-time
   ( has-time-elapsed "0" )
   ( Do-Nothing
   )
   ( send-message
      "#Dalek"
      "High"
      "Pro-crasti-nate"
   )
   )
)
+Name: Procratination
+Repeat Count: 99999999999
+Interval: 1

 

Offline Ransom

  • M. Night Russel
  • 210
  • It will not wait.
    • Rate of Injury
Re: Sunshafts / Crepuscular Rays / Lightshafts (Committed!)
Rule of cool is one thing, but this actually weirds up the playfield's visual consistency and sense of depth.

its an APPROXIMATION. Yes the rays SHOULD be cast through the medium and not as a screen space effect. BUT 1. not possible without rendering real shadow volumes ( You dont want that trust me ) and 2. its a pretty close approximation what happens if the rays are coming from the front (as is ON SCREEN).

PROTIP: Don't like it dont turn it on.

I understand that I have the option to leave it off. No need to get snippy, I'm just trying to be constructive.

I'm not saying I want the effect physically cast through the medium, and I'm fine with only being able to see it when I'm facing the sun - I'm saying the effect would work better, visually, if it was under (or appeared to be under) the white-out. I take it that's impossible?
« Last Edit: December 12, 2011, 06:37:42 am by Ransom »

 

Offline Dark RevenantX

  • 29
  • anonymity —> animosity
Re: Sunshafts / Crepuscular Rays / Lightshafts (Committed!)
Just scale down the effect until it looks cool but is subtle enough that nobody* bothers to raise issue with it.  It's a cool effect that makes the sun look better.  Shadow volumes are rendered differently than this and will never work in the same way as god rays, because god rays are literally a screen-space effect hacked in to milk the shadow-related code for all it's worth.

*0.1% of players

 

Offline Valathil

  • ...And I would have had a custom title if it wasn't for you meddling kids!
  • 29
  • Custom Title? Wizards need no Custom Title!
Re: Sunshafts / Crepuscular Rays / Lightshafts (Committed!)
actually the lightshafts code has nothing to do with the shadow code thats why its released seperately. i propose that people play around the parameters that i exposed in the table and post their settings like with different lighting settings.
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 

Offline Kolgena

  • 211
Re: Sunshafts / Crepuscular Rays / Lightshafts (Committed!)
Speaking of which, I found the weight and intensity functions to do basically the same thing. As long as their product is the same, the effect looks identical. There is no difference between 0.5 intensity 0.02 weight, 1.0 intensity 0.01 weight, and 0.1 intensity 0.1 weight. Is this intentional? (Also, falloff doesn't seem to be tweakable. Anything other than 1 causes strange behavior)

I can post up the values I have for super low-spec performance. Shadow shafts are much shorter, but do not exhibit much banding. The shorter shadow shafts look reasonable since the intensity of the effect is low. In-mission performance will drop from 70-80 fps to ~60 fps with sunshafts turned on with these settings (1366x768)
#Light Shafts
$AlwaysOn:      YES
$Density:       0.18
$Falloff:       1.0
$Weight:        0.06
$Intensity:     0.06
$Sample Number: 18

 -spec -glow -env -nomotiondebris -missile_lighting -normal -post_process -soft_particles -no_vsync -cache_bitmaps -orbradar -ship_choice_3d -3dwarp -warp_flash -snd_preload -fb_explosions -fps  -fov .6 -spec_exp 11 -spec_tube 1.2 -spec_point 1.1 -spec_static 2.3 -ambient_factor 80 -ogl_spec 90 -bloom_intensity 80 -fxaa_preset 0
$Name:      saturation
$Uniform:   saturation
$Define:   FLAG_SATURATION
$AlwaysOn:    true
$Default:   0.75
$Div:      50
$Add:      0

$Name:      contrast
$Uniform:   contrast
$Define:   FLAG_CONTRAST
$AlwaysOn:    true
$Default:   1.05
$Div:      50
$Add:      1

 

Offline Valathil

  • ...And I would have had a custom title if it wasn't for you meddling kids!
  • 29
  • Custom Title? Wizards need no Custom Title!
Re: Sunshafts / Crepuscular Rays / Lightshafts (Committed!)
falloff should be <= 1.0
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 

Offline Kolgena

  • 211
Re: Sunshafts / Crepuscular Rays / Lightshafts (Committed!)
Thanks for the tip! Apparently intensity needs to be tweaked up if falloff is to be <1.0. Last time I tried, I thought I turned the effect off by setting falloff to something like 0.5

#Light Shafts
$AlwaysOn:      YES
$Density:       0.14
$Falloff:       0.8
$Weight:        0.2
$Intensity:     0.2
$Sample Number: 20

looks and performs decently to me.

A couple suggestions:

In nebula, when ships pop in, usually they're invisible because they're the same color as the nebula. Now they cast a very obvious shadow beam, so popup is fairly horrendous now. If the shadow slices are rendered to be the same color as the nebula background instead of black, it may help.

Allow rendering of lens flares and coronas. It'd be cool to have those on top of sunshafts.

What if the screen white-out effect was just lost all-together and replaced it with a corona/flare texture centered on the suns, similar to what devildozen tried to illustrate in his concept pictures? This could help alleviate the weirdness of needing to stare directly at a sun for stronger light shafts to appear. (Existing flares seem to render fine without a sun on screen as well, though I suspect it's more of a rotatable texture glued onto the skybox)
« Last Edit: December 13, 2011, 02:44:25 pm by Kolgena »

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Sunshafts / Crepuscular Rays / Lightshafts (Committed!)
Allow rendering of lens flares and coronas. It'd be cool to have those on top of sunshafts.

Yeah, I wondered why those disappeared when I turned on godrays (/notgivingintostupidpoliticalcorrectness). I'm sure Valathil did it because he knows best, but I'm still curious if there is a reason why the can't both be working?

EDIT: Perhaps it's just me, but I'm pretty sure we shouldn't be getting whiteout effects when the sun is behind a ship... (See attachment)

[attachment deleted by a basterd]
« Last Edit: December 13, 2011, 07:26:13 pm by mjn.mixael »
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Valathil

  • ...And I would have had a custom title if it wasn't for you meddling kids!
  • 29
  • Custom Title? Wizards need no Custom Title!
Re: Sunshafts / Crepuscular Rays / Lightshafts (Committed!)
did i forget the lensflares and coronas ? OOOPS ill work on a patch tomorrow

situation in screenshot is correct tho
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛