Jump to content
  • Advertisement
Sign in to follow this  
mrMatrix

Bloom race condition with animation causing black squares?

This topic is 541 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a bloom shader which works perfectly when I have static objects. I do a 6x down sampling then 6x gaussian blur then I composite the bloom over the source.

 

When I add in Assimp animation I get NaN errors at certain angles in the form of black squares which I can confirm are NaN by doing isnan(). Certain angles while animating also make my tonemapping shader go crazy. I've tried to add in fences with glFenceSync and glClientWaitSync but it doesnt do anything. Is synchronization the issue? I assume the animated assimp model isn't in sync with the bloom.

 

k4a2pc.jpg

Share this post


Link to post
Share on other sites
Advertisement

It's much more likely that you have a bad calculation (such as a divide by 0) in one of your shader programs. Since it's related to animation, I would guess that you're somehow producing a zero-length (or otherwise invalid) normal vector in your vertex shader program. You may want to try a debugging tool like RenderDoc to see if you can validate the outputs from your vertex shader.

Edited by MJP

Share this post


Link to post
Share on other sites

Thanks, NaN was indeed the cause for the black squares. However, a real solution is proving to be quite tricky.

Edited by mrMatrix

Share this post


Link to post
Share on other sites

I had some issues with both RenderDoc and Nsight. With RenderDoc I was getting consistently the wrong final color. With Nsight I am unable to do live shader debugging on my current card (gtx 950) since they only support it on old Kepler / Fermi cards. Is it worth it to spend cash on an old card to do Shader Debugging in Nsight?

Edited by mrMatrix

Share this post


Link to post
Share on other sites

Just debug by hand. Grab your animation shader and, in the fragment shader, write something visible when fragments become NaNs. Like bright pink/green/yellow. That ought to tell you something.

Share this post


Link to post
Share on other sites

Just debug by hand. Grab your animation shader and, in the fragment shader, write something visible when fragments become NaNs. Like bright pink/green/yellow. That ought to tell you something.

But isnt it common practice to shader debug with Nsight? And all that I've read says that it can only be done with a Kepler gpu such as a 670/680. I've been looking at this problem for over a week now and I'll do anything to solve it. The problem does have to do with NaN but why it happens isnt easy for me to describe or fix without having that "edge" that I've seen in Nsight tutorial videos. I think my best option would be to order a Kepler gpu. This could help me in the future as well as my shaders get more complex.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!