I am rewriting an unfinished SceneKit project as RealityKit (NonAR). As far as I can see, RealityKit is missing basic fog functionality?
Fog was simple & easy to implement in SCeneKit (fogStartDistance / fogEndDistance / fogDensityExponent / fogColor). Are there any plans to implement something like this in RealityKit? Are there any simple workarounds?
Hello,
As @kemalenver suggests, RealityKit's modern rendering API requires some familiarity with shaders for post-processing effects like depth-based fog.
The simplest depth-based fog is implemented in a fragment shader that linearly blends a pixel in the frame buffer with a fog color weighted by distance.
You'll find something similar in this sample Creating a fog effect using scene depth which renders with Metal.
Likewise, check out Explore advanced rendering with RealityKit 2 for another fog effect implemented in RealityKit.
Re: "I think you can also use CGFilters for post processing which is pretty cool." do you mean CIFilters? (and yes, cool!)
Please request more sample code with the Feedback Assistant.