Obi Official Forum
Bug / Crash Reflections appear in play mode but not in build - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html)
+--- Thread: Bug / Crash Reflections appear in play mode but not in build (/thread-3564.html)

Pages: 1 2


Reflections appear in play mode but not in build - locque - 25-08-2022

[Image: 1YbjDVd.png] [Image: RfKSGww.png]

Can this be fixed? Both screenshots were taken in the exact same scene and the same camera / renderer settings, there are simply no reflections at all in the build. The camera and fluid renderer have default settings other than reflections, smoothness, and surface downsampling being turned up to the maximum.


RE: Reflections appear in play mode but not in build - josemendez - 26-08-2022

(25-08-2022, 09:37 PM)locque Wrote: [Image: 1YbjDVd.png] [Image: RfKSGww.png]

Can this be fixed? Both screenshots were taken in the exact same scene and the same camera / renderer settings, there are simply no reflections at all in the build. The camera and fluid renderer have default settings other than reflections, smoothness, and surface downsampling being turned up to the maximum.

Hi,

Could not reproduce this on Mac/Windows builds, using either the built in pipeline or URP.

Which render pipeline are you using, and what platform are you building for?


RE: Reflections appear in play mode but not in build - locque - 26-08-2022

(26-08-2022, 07:50 AM)josemendez Wrote: Hi,

Could not reproduce this on Mac/Windows builds, using either the built in pipeline or URP.

Which render pipeline are you using, and what platform are you building for?

I'm building Windows 10, builtin RP on 2021.3.8f1. I can upload a sample project later if that helps.


RE: Reflections appear in play mode but not in build - locque - 28-08-2022

Okay here is the sample project and a build: https://we.tl/t-nMzSxieWW9

I thought the problem might come from the shader modifications you gave me to fix lighting in stereo rendering and filter the shadowmap, but that doesn't seem to be the case as this also happens with the stock obi files from the asset store in a fresh project with nothing other than the dependencies.

I also tried using a custom reflection probe and the global environment probe, manually adding all obi fluid shaders to the always included list in the graphics settings, accepting or declining script upgrades when importing, nothing made any difference.

Switching to URP doesn't help either, but interestingly actually makes it worse since reflections are now missing in play mode too. Could that narrow down what's going wrong?


RE: Reflections appear in play mode but not in build - josemendez - 29-08-2022

(28-08-2022, 05:55 PM)locque Wrote: Okay here is the sample project and a build: https://we.tl/t-nMzSxieWW9

I thought the problem might come from the shader modifications you gave me to fix lighting in stereo rendering and filter the shadowmap, but that doesn't seem to be the case as this also happens with the stock obi files from the asset store in a fresh project with nothing other than the dependencies.

I also tried using a custom reflection probe and the global environment probe, manually adding all obi fluid shaders to the always included list in the graphics settings, accepting or declining script upgrades when importing, nothing made any difference.

Switching to URP doesn't help either, but interestingly actually makes it worse since reflections are now missing in play mode too. Could that narrow down what's going wrong?

Hi!

Will download and try the project asap. In the past I've seen cases where Unity would not keep the reflection probes around until the point where fluid is rendered during the frame, this was reported as a bug and fixed but depending on the Unity version you're using it might still be an issue.

will get back to you once I try the project out.


RE: Reflections appear in play mode but not in build - josemendez - 01-09-2022

(29-08-2022, 11:58 AM)josemendez Wrote: Hi!

Will download and try the project asap. In the past I've seen cases where Unity would not keep the reflection probes around until the point where fluid is rendered during the frame, this was reported as a bug and fixed but depending on the Unity version you're using it might still be an issue.

will get back to you once I try the project out.

Hi there,

I've tried your build (Windows 10, Core i9, RTX 3070), as well as built my own using the project (MacOS 10.15.4, Core i7, AMD Fire Pro D300), reflections work fine for me in both which is strange, I would expect them to fail at least in your build. Here's a video:



Had another user report a similar issue a while ago, I wasn't able to reproduce it back then either:
http://obi.virtualmethodstudio.com/forum/thread-3444.html?highlight=reflection

Obi simply reads from the reflection probes, so as long as they contain valid data it stands to reason they should work. Maybe they aren't being properly built for some reason? Do reflections work for other objects in the scene besides fluid?

Another question, what rendering API are you using? I'd assume DX11?


RE: Reflections appear in play mode but not in build - locque - 01-09-2022

(01-09-2022, 09:47 AM)josemendez Wrote: Obi simply reads from the reflection probes, so as long as they contain valid data it stands to reason they should work. Maybe they aren't being properly built for some reason? Do reflections work for other objects in the scene besides fluid?

Another question, what rendering API are you using? I'd assume DX11?

Yes, reflections work fine for everything else.

The API is set to auto by default, if I disable it Direct3D11 is the only option so I assume yes.

I can't test a Vulkan build since that won't compile because of a bunch of shaders in my project it doesn't like, but I can enter play mode and the reflections are gone here too now.


RE: Reflections appear in play mode but not in build - josemendez - 02-09-2022

(01-09-2022, 04:56 PM)locque Wrote: Yes, reflections work fine for everything else.

The API is set to auto by default, if I disable it Direct3D11 is the only option so I assume yes.

I can't test a Vulkan build since that won't compile because of a bunch of shaders in my project it doesn't like, but I can enter play mode and the reflections are gone here too now.

Tried your build on another computer with a different GPU (Core i7, 1080GTX) and reflections do appear black in there. I have no idea what's going on, or why the same build would work differently on different computers.

Will investigate further and keep you updated about anything I find.


RE: Reflections appear in play mode but not in build - josemendez - 02-09-2022

Have been testing the build in 2 computers: the one in which it works and the one in which it doesn't. In the one that works, I've enabled the Frame debugger in the editor, and took a look at the contents of the specular probe during fluid rendering. It looks ok:

[Image: Zk51Gst.png]

When remotely connecting the frame debugger to a development build in the computer where reflections don't work, I found that the reflection probe isn't bound to the shader at all, so when the shader reads from it, it gets pitch black as a result:

[Image: r5jGQn5.png]

Looks like Unity sometimes evicts the reflection probe after rendering the skybox. Not sure about the meaning of "sometimes" here, though. Its' also really strange that this behavior depends on the specific machine where the build is running.

Obi's fluid shader reads unity_SpecCube0, which according to Unity's documentation is the correct way to access the default specular probe. I'm reporting this as a bug to Unity. Reflection probes should either be available until the end of the frame, or if they're not available under certain circumstances, these should be documented.

In the meantime if your fluid rendering depends on reflections, I can write a custom fluid shader for you that accepts a cube map as input for reflections. Not as good as using the built-in reflections, but should get the job done.

kind regards,


RE: Reflections appear in play mode but not in build - locque - 03-09-2022

Thanks for digging into this! I would have never figured it out.

I would gladly take the custom shader if it's not too much trouble, it would be great to have them on the oil fluid I'm using because it's almost invisible if the light is at the wrong angle and there is no specular highlight.