I have a scene with post processing enabled, dof being one of the effects.
I have some objects designed to be unlit, crisp and “on top” of the rendered scene.
In the image you can se that the dof affects the white object. Plus the white object is overlapped by the particle quad
Hello there – we have an experimental AI bot that might be able to help you with your question. Would you like to try this out?
How it works:
Reply to the messages of the bot that end with a thread_id to interact with it and ask follow-up questions. You can also mention the bot directly in this channel to get help.
Hello SteffenMFureli. It seems like you’re facing an issue where DoF (Depth of Field) post-processing is affecting the visibility of “unlit” crisp objects that should appear on top of other elements.
Given that “unlit” objects should not be affected by lighting or post-processing effects, you might want to ensure that such objects are rendered after the post-processing effects are applied. This is typically done using render queues or layers that allow you to control the order in which objects are rendered.
Here’s a suggested approach to ensure the unlit objects are rendered on top and unaffected by DoF:
Make sure the unlit objects have a material that does not interact with lighting or post-processing. This may involve setting the depthWrite property to false.
You can use a RenderTexture to render the scene with DoF applied, then render the unlit objects onto this texture separately (see the documentation).
Sort the render order of the objects, ensuring that the unlit objects are rendered last.
Step by step in pseudocode:
Render the main scene to a RenderTexture with DoF applied.
Change the material of unlit objects to ensure they are unaffected by post-processing effects.
Render the unlit objects onto the RenderTexture.
I hope this helps resolve the visibility issue you’re experiencing. If you need assistance with specific implementation details, such as code, let me know!
To create a material that doesn’t interact with post-processing effects like Depth of Field (DoF), you can adjust the properties of the material.
In the case of DoF, you would want to ensure that the material of the object has the depthWrite property set to false. This property controls whether the object writes to the depth buffer, which is used by post-processing effects like DoF to determine the blur amount based on depth.
Here’s a TypeScript code example of creating a material that doesn’t interact with post-processing:
import { MeshBasicMaterial } from 'three';
const unlitMaterial = new MeshBasicMaterial({ color: 0xffffff, depthWrite: false });
In this code, we create a MeshBasicMaterial for the unlit objects and set the depthWrite property to false. This will ensure that the unlit objects don’t affect the depth buffer used by post-processing effects, allowing them to appear on top unaffected by DoF.
Let me know if you need further assistance with this or any other related topic!
0 messages leftGPT 3.5 thread_39td1FIPOQpGbRLIi2ReAZGM Thanks for your feedback!
This would make the mesh not affect dof, but the rendered pixels produced from the material recieves the dof effect, as it is applied to the whole render
For the dot itself that could work, yes, I’ll give it a go. Thanks
But I also have ĂĄ box I need to render without the dof effect, like in the appended image.
I suppose a RenderTexture approach might be possible if combined with Screenspace UI? Something to look into atleast.
You can have multiple cameras, but only the main cam renders automatically - you can have an onAfterRender() method that calls “renderNow” on your second cam. Make sure to turn depth clear on and color clear off on that second camera
It would - and you can also build that of you want to. We didn’t because, well, the URP API just changes too much to be worth the effort compared to “here’s how you render a second camera on top”
One early design choice we did for Needle Engine is that only one camera renders by default, in contrast to Unity where all cameras render by default in a random order - they kind of had to build render stacks to work around that legacy