Author Topic: Deferred Lighting and soft shadows  (Read 69240 times)

0 Members and 1 Guest are viewing this topic.

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Deferred Lighting and soft shadows
I get the same.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline Swifty

  • 210
  • I reject your fantasy & substitute my own
Re: Deferred Lighting and soft shadows
I think i'm just going to take out the fixed function checkbox in the lab viewer. All these new features make it really hard to easily switch between the two rendering modes during runtime.

 
Re: Deferred Lighting and soft shadows
I get too + I don't see damage lightning when enabled.

 

Offline DahBlount

  • Moderator
  • 29
  • Alpine ☆ Cancer Tribulation
    • Minecraft
    • Skype
    • Steam
Re: Deferred Lighting and soft shadows
I just noticed this recently but, playing on this build with my motherboards automatic OC system causes the game to stutter. Is there any explanation or precedent for such a thing?
<Axem> yet still more insightful than #hard-light

<Axem> jad2.23 will just be cat videos

<DahBlount> So
<DahBlount> JAD2.2 is like that
<Axem> maybe
<Axem> it can be whatever you like!
<DahBlount> A Chocolate Sundae?
<Axem> sure

My models: GTF Gilgamesh - GTD Nuadha [Redesigning] - Ningirama [WIP] - GTG Zephyrus

 

Offline Swifty

  • 210
  • I reject your fantasy & substitute my own
Re: Deferred Lighting and soft shadows
Turn on Disabled batched model rendering in Troubleshooting

 

Offline DahBlount

  • Moderator
  • 29
  • Alpine ☆ Cancer Tribulation
    • Minecraft
    • Skype
    • Steam
Re: Deferred Lighting and soft shadows
That helps a bit, there is still the occasional jump though. Is the problem with overclocking in general or because I'm using an auto overclock mechanism?
<Axem> yet still more insightful than #hard-light

<Axem> jad2.23 will just be cat videos

<DahBlount> So
<DahBlount> JAD2.2 is like that
<Axem> maybe
<Axem> it can be whatever you like!
<DahBlount> A Chocolate Sundae?
<Axem> sure

My models: GTF Gilgamesh - GTD Nuadha [Redesigning] - Ningirama [WIP] - GTG Zephyrus

 
Re: Deferred Lighting and soft shadows
That helps a bit, there is still the occasional jump though. Is the problem with overclocking in general or because I'm using an auto overclock mechanism?

In general the auto-overclocking is pretty reliable, but there are certainly applications that just have a harder time with it.  I know for instance that there are even some enterprise applications that require dynamic over/underclocking to be disabled in order to function properly.  Could be a situation like that, could be an issue with your CPU, as I use AMD CPUs with it enabled and haven't really run into the problem at all.

 

Offline DahBlount

  • Moderator
  • 29
  • Alpine ☆ Cancer Tribulation
    • Minecraft
    • Skype
    • Steam
Re: Deferred Lighting and soft shadows
I haven't tried to manually overclock before, but the dynamic overclock feature does great with other games so I don't think it's my cpu. I'll write down some base settings and try manually overclocking in the near future.
<Axem> yet still more insightful than #hard-light

<Axem> jad2.23 will just be cat videos

<DahBlount> So
<DahBlount> JAD2.2 is like that
<Axem> maybe
<Axem> it can be whatever you like!
<DahBlount> A Chocolate Sundae?
<Axem> sure

My models: GTF Gilgamesh - GTD Nuadha [Redesigning] - Ningirama [WIP] - GTG Zephyrus

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Deferred Lighting and soft shadows
Okay so this isn't a bug, but its a quality thing that kind of bugs me (Ha Haaa).



It's the 'lod' of the shadow map (so to say, I dont know the proper term), its very easy to spot the very ugly transition on larger objects when you fly next to them, as it happens pretty much right under the nose. I think the easy fix for this is to just increase the distance for the quality transition. I dont know how much of a hit performance it would be, but some extra 500 range would probably go a long way to make this far less visible.
(Or maybe im just missing some quality setting and the default is set to be kinda low?)

Or maybe I'm wrong about all of these things and it actually is some kind of bug/oddity?
You tell me!
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

 
Re: Deferred Lighting and soft shadows
I don't think that's a problem with a quality swap(like you'd swap models). Looks like regular tearing to me and the FPS counter says you're under 60. Maybe shadows always update at 60 Hz, regardless of your framerate. That would also explain why the "higher quality" shadows appear to be smaller and not really higher in quality.
[19:31] <MatthTheGeek> you all high up on your mointain looking down at everyone who doesn't beam everything on insane blindfolded

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Deferred Lighting and soft shadows
No, thats not it, FrikgFeek.
And fps always takes a slight dip when taking a screenshot.
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 Kolgena

  • 211
Re: Deferred Lighting and soft shadows
The shadow maps are cascaded, so that further shadows are lower resolution to save resources. Here, the transition is obvious. It's not screen tearing, and is probably much more obvious in motion, if it crawls along as your ship moves.

IMO looks like the problem is that the gaussian (?) blurring is tied to shadow texture resolution, so the effective blur radius is larger the lower the shadow texture resolution is.

There's also some blending oddities happening with overlapping shadows there. You can see some "bright" outlines/halos in the shadow under the big metal beam, particularly where the orange and tan metal plates meet. (looks like the silhouette of a house, sort of)

 

Offline Swifty

  • 210
  • I reject your fantasy & substitute my own
Re: Deferred Lighting and soft shadows
there are ways to make the cascade transitions less obvious by sampling both cascades within certain thresholds. I wouldn't really say this is a critical thing to do but more like a nice to have thing later down the line.

 
Re: Deferred Lighting and soft shadows
What're the dependencies for this thing? I'm trying to build it myself but I'm getting

Code: [Select]
cutscene/oggplayer.cpp: In function ‘void OGG_video_init(theora_info*)’:
cutscene/oggplayer.cpp:367:44: error: ‘shader_type’ is not a class or namespace
    int sdr_handle = gr_maybe_create_shader(shader_type::VIDEO_PROCESS, 0);
                                            ^

EDIT: oh, this is a build problem, not a dependency one. I have no idea what to do about this, then.
« Last Edit: March 19, 2015, 07:53:40 am by Phantom Hoover »
The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Deferred Lighting and soft shadows
EDIT: oh, this is a build problem, not a dependency one. I have no idea what to do about this, then.
Latest code still builds fine for me: have an SSE2 build and an AVX build.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 
Re: Deferred Lighting and soft shadows
Right, I should've mentioned that I'm trying to do this on Arch Linux. Is this build actually tested on OSes other than Windows?
The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Deferred Lighting and soft shadows
That did look like a Linux error and not a Visual C++ one.  It's possible that autotools just needs to have some source files added to it.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 
Re: Deferred Lighting and soft shadows
Is that something I can try?
The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Deferred Lighting and soft shadows
I believe you could, I was going to test my theory on my Linux VM first before stating that's the problem though.

Code: [Select]
cliff.gordon@Cliff-Gordons-MBP:~/Freespace-Open-Swifty [shader_transform_deferred]  $ git diff origin/master HEAD code/Makefile.am
diff --git a/code/Makefile.am b/code/Makefile.am
index 8ca29fb..f05ef78 100644
--- a/code/Makefile.am
+++ b/code/Makefile.am
@@ -343,6 +343,7 @@ FS2_SOURCES =       \
        graphics/grstub.cpp     \
        graphics/grstub.h       \
        graphics/line.h \
+       graphics/shadows.cpp \
        graphics/tmapper.h      \
        hud/hud.cpp     \
        hud/hud.h       \
@@ -501,6 +502,7 @@ FS2_SOURCES =       \
        model/modelsinc.h       \
        model/modeloctant.cpp   \
        model/modelread.cpp     \
+       model/modelrender.cpp   \
        nebula/neb.cpp  \
        nebula/neb.h    \
        nebula/neblightning.cpp \

It looks like the .cpp files were added but not the .h files for some reason.  If you edit code/Makefile.am and add the shadows.h and modelrender.h by their respective .cpp entries in that file, it might just work.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 
Re: Deferred Lighting and soft shadows
That doesn't seem to have helped, unfortunately.
The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell.