Chaos Corona Forum

Chaos Corona for Cinema 4D => [C4D] I need help! => Topic started by: Konichowaa on 2022-11-29, 11:28:46

Title: distance shader & active camera
Post by: Konichowaa on 2022-11-29, 11:28:46
can you use the distance shader with the active camera as the 'from object' ?

I have a really large scale sc
Title: Re: distance shader & active camera
Post by: Beanzvision on 2022-11-29, 12:15:32
Hi there, may I ask what exactly you're trying to do? I think it should be possible but would need more info. ;)
Title: Re: distance shader & active camera
Post by: TomG on 2022-11-29, 12:48:32
Sure is, I used to use this to do "slicer/cutaway" effects which made surfaces transparent as the camera moved closer. (now, I'd use the Slicer ;) )
Title: Re: distance shader & active camera
Post by: Konichowaa on 2022-11-29, 13:51:09
hi Tom and Bengamin,

sorry some of my message hasn't posted well...

I'm working on a large scale project (a house with a few hectares of field/vineyard around it) and I'm trying to do the grass fields with scatters.
There is actually no need to scatter them too far away because my final image will be only 4000 pixels wide and the scatters themselves wouild not be visible.
Therefore I want to see if I can use the near/far clippin in the scatter object to limit the clones, but the soil is actually brown, so when I clip the scatter, in the distance my surface is still brown whereas it should be greenish.

Thus, I would like to limit the scatter p.e. at 10.000cm, and change the soil from brown to grass shader with a distance shader around that same distance (matching the green colour of the scattered elements).

In my project I  have about 50 cameras throughout the terrain, in a stgae object. I can use a specific camera as the distance shader object, but not the keyframed (active camera) in the stage object.
Title: Re: distance shader & active camera
Post by: Beanzvision on 2022-11-29, 14:52:38
I'm wondering if the LOD object and camera clipping would be useful here? You could have multiple variations in detail of the scattered object and then use the settings to determine what level of detail is visible close range to the camera etc.
Title: Re: distance shader & active camera
Post by: BigAl3D on 2022-11-29, 23:45:03
If neither of those ideas work for you, I would suggest not trying to do everything in one shot with only one tool. In other words, you can easily solve some of your issues manually. If that distant area of land should have either low-poly foliage or none, just cut the ground object there and apply a texture of your foliage. Would look fine at a distance and render super fast. You could render a still of the foliage in the distance and use that as the texture.

I assume you are also taking advantage of the Scatter Camera Clipping feature. This will at least remove all the clones on either side of the view. Just use the Extend View feature to ensure you don't get gaps or funky shadows. In fact, you can use a spline to eliminate clones in those far off area. Super easy.