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

0 Members and 1 Guest are viewing this topic.

Re: Deferred Lighting and soft shadows
OK so after investigating a bit more on IRC it looks like this is happening because you're using a Microsoft extension to define the shader_type enum. This is obviously not acceptable on a cross-platform application like the SCP so it'll need to be rewritten, but it's looking like just removing all the instances of 'shader_type::' might be enough to fix it.
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.

 
Re: Deferred Lighting and soft shadows
After a brief bughunt I've got it compiled and running, I'll upload the changes somewhere soon.
« Last Edit: March 19, 2015, 09:04:42 pm 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 chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Deferred Lighting and soft shadows
Oh?  Was just looking at it myself, I realized that shader_type is defined in 2d.h which is included in that file, but I wondered if it was a syntax compat issue with gcc or something.
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
Diff is here: http://sprunge.us/BWHY

Summary of changes: all instances of 'shader_type::' have been programmatically removed. Probably I should have replaced it with a suffix instead, rather than having all those enums floating around the global namespace. model/modelrender.cpp has had #include <algorithm> added to allow use of std::sort. A set of curly brackets have been added to graphics/gropenglshader.cpp in the opengl_compile_shader function to prevent a scope error from the piece of code it surrounds.

The build is functioning on my end, except that if I start firing weapons it completely freezes after about a second. (log) This could be a problem with my graphics setup, so unless someone else tests it I can't say much. (It is my hypothesis after further testing that the lockup happens if any weapon is fired, at least on fighters.)
« Last Edit: March 19, 2015, 09:23:39 pm 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 Swifty

  • 210
  • I reject your fantasy & substitute my own
Re: Deferred Lighting and soft shadows
thanks for the patch, I'll commit that when I get the chance.

And sorry about the crashes. I kind of wonder if these crashes are related to the beam crashes people have been getting on Nvidia drivers. I guess I'm going to have to do some rigorous testing this weekend on my Nvidia box.

 
Re: Deferred Lighting and soft shadows
Continuing on the trail of this crash, I've got another debug log out of it with a slightly different spew at the end: http://sprunge.us/WPQC

I've also noticed that the crash only seems to happen with lighting detail settings of 4/5 or higher, so I started playing Costs of War from WiH1 and stepped up the setting until I got a crash. This is the log from that: http://sprunge.us/LCYW
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.

 
Re: Deferred Lighting and soft shadows
More testing: the crash only occurs with lighting detail of 4 or above, and, it seems, only after a certain number of shots are being rendered at once. I've also gotten a stack trace from when the game's locked up: http://pastebin.com/idt06WUH
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
Does the crash happen with trunk builds in a similar fashion?
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
No, though there is another, qualitatively different freezing bug that ends up requiring a hard reboot. Because of that I'm giving up on FSO until I get home to my desktop in a few days, unless there are any specific tests you want me to run; this is really looking like a problem with my hardware/drivers.
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 Swifty

  • 210
  • I reject your fantasy & substitute my own
Re: Deferred Lighting and soft shadows
That stack trace helps a lot, thank you.

 
Re: Deferred Lighting and soft shadows
Probably worth noting that that stack trace was generated by allowing the game to freeze and then crashing it with an artificial segfault. That particular bit of code isn't causing an actual crash, it's just whatever the game was doing in its locked-up state when I crashed it.
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 Swifty

  • 210
  • I reject your fantasy & substitute my own
Re: Deferred Lighting and soft shadows
I have a sinking suspicion that it might be the deferred lighting code that's causing these issues based on what you reported (Firing a laser which in turn pushes out a point light for rendering) combined with your stack trace. Have you tried running the game with deferred lighting disabled?

 
Re: Deferred Lighting and soft shadows
Well like I said I've never encountered that particular bug on trunk, and I too strongly suspect that it's caused by the lighting. But I'd really like to put this on hold until I can try it on slightly more reliable hardware and drivers.
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 Swifty

  • 210
  • I reject your fantasy & substitute my own
Re: Deferred Lighting and soft shadows
You can disabled deferred lighting in the launcher in the Graphics tab on my builds. It'll revert back to the old way of doing lighting and will let me know if something else in my code is causing the issue or if it really is the deferred lighting code path being the culprit.
« Last Edit: March 20, 2015, 03:11:46 pm by Swifty »

 
Re: Deferred Lighting and soft shadows
Is it just me or do these builds make framebuffer explosions look really weird? They flicker a lot and look kinda poor.
[19:31] <MatthTheGeek> you all high up on your mointain looking down at everyone who doesn't beam everything on insane blindfolded

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Deferred Lighting and soft shadows
Is it just me or do these builds make framebuffer explosions look really weird? They flicker a lot and look kinda poor.
I noticed and then forgot to mention it; thanks for bringing it up.
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
Just committed a fix for shockwave distortions in my git repo.

So I haven't much luck reproducing the crashers on my Nvidia machine. I did get one crash when firing lasers during gameplay but the Heisenberg Uncertainty Principle has seemed to come into effect as the crash didn't appear the second time as soon as I had a debugger ready to hook up to the game. I did notice that models occasionally don't get rendered and this happens entirely at random, also making this difficult to debug.

A suspicion I had is that perhaps the OpenGL errors in my debug logs are the culprit. So I decided to figure out what specific errors OpenGL was reporting. I hooked up AMD CodeXL's OpenGL debugger/profiler to the engine to get more data. It looks like we force the disabling of texture units when they're already disabled. OpenGL doesn't seem to be happy with that.

The resulting fix I made is something that should probably go into trunk. I'll probably post a patch in the SCP internal for review. So perhaps that fix will solve these crashes but I can't promise anything.
« Last Edit: March 22, 2015, 01:16:26 am by Swifty »

 
Re: Deferred Lighting and soft shadows
Yep, that's fixed the weapon lighting crash! I'll see if it's done anything about the hard lockups as well.
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.

 
Re: Deferred Lighting and soft shadows
Hope it's alright to give feedback for the new HDR builds here because there's no separate "HDR builds" thread.
Compiled an AVX build from your repo, and it seems to have some problems with lights clipping through solid surfaces when they really shouldn't, especially noticeable with engines.


Look at the Raynor's engines here

They also seem to cast shadows on engine trails(not sure about this one though, but it does happen when I fly under a big ship)



AMD GPU(upgraded to a 290X), 15.3 beta drivers. Sorry if this is nothing new and if people already let you know through IRC or whatever.
[19:31] <MatthTheGeek> you all high up on your mointain looking down at everyone who doesn't beam everything on insane blindfolded

 

Offline The Dagger

  • 29
  • I like zod ships
Re: Deferred Lighting and soft shadows
The engine glow leaking happens in trunk too, so I don't believe it's HDR related.