kode80 / kode80CloudsUnity3D

A realtime volumetric cloud rendering solution for Unity3D.
367 stars 64 forks source link

Clouds don't render when multiple cameras are active (1.1.1, Unity 5.3.4) #2

Closed Candescence closed 8 years ago

Candescence commented 8 years ago

Attempted to use this with PixelRender, clouds didn't render, wondered if it was a render texture problem until I realized that it simply doesn't work if there are simply just two regular cameras active.

kode80 commented 8 years ago

I'm going to give this a try, using PixelRender as the first test case. Can you just confirm that you set the kode80 Clouds' "Target Camera" property to the PixelRender camera (not the main camera)?

Candescence commented 8 years ago

Yeah, I can confirm that. I've tested that multiple times with each active camera in that property. The clouds only work with one active camera no matter what.

kode80 commented 8 years ago

Alrighty, this is now fixed in develop branch and will be in the next official update.

If you'd like to patch your version before then, it's a one line change. Open kode80Clouds.cs, find the SetCamera() method and after the line "_camera = theCamera", add the following line:

"_fullScreenQuad.targetCamera = theCamera;"

Here's a link to the commit on develop branch if you need clarification: https://github.com/kode80/kode80CloudsUnity3D/commit/c10308ac288b1cf30336768a66abc5490844e61d

Let me know how you get on.

Candescence commented 8 years ago

Confirmed, it works! Fantastic. Simple solution, too! XD

kode80 commented 8 years ago

Excellent, glad to hear it!

creywillis commented 7 years ago

Hi, I´m having the same issue with more than 1 cam. I´ve added the line you suggested, still not working on any cam other than the initial one.. any ideas?