August 14, 2021, 9:50am
Hi, been trying to get planer reflections working by following the example demo, i plug all the assets in, in the same way presented in the demo but i keep getting an error which is:
Cannot set property ‘renderTarget’ of null
I’m trying to understand how to use planer reflections for a big product configuator projects I’m working on so getting this working would be fantastic.
Where am I going wrong?
Make sure to create the required scene layers in your project as well, check the example project on that:
After you create them and order them as required, don’t forget to add the
Mirror layer to your active camera and any other entity that will be casting reflections.
August 14, 2021, 9:56am
To add to Leonidas, I think the example needs an update, as it is probably using an old API for render target. Perhaps,
@yaustar can update at some point.
@Arnie you can grab an updated
mirror.js from this project:
August 14, 2021, 10:18am
Thanks for this updated version, it did indeed fix some deprecation API warnings.
August 14, 2021, 10:20am
Okay so took a look at all this layering and replicated it, no compile errors anymore, and its rendering “something” but its not quite working as expected.
It looks like this:
Is there something I need to modify in the code?
August 15, 2021, 9:59am
After some fiddling it seems that the example shows a checkbox ticked that should’nt be ticked in order for reflections to work.
Please make sure that that tickbox is unchecked and it should work once all your layering and render order is set up
So nearly there but another issue has reared its head, the planer reflections work perfectly when the reflection plane is horizontal, but once the reflection plane is vertical, the reflections become upside-down and offset positionally.
Is this just a limitation of planer reflections?
Thanks for sharing that!
I vaguely remember somebody else had the same issue, not sure if it was resolved.
@LeXXik any idea?
August 15, 2021, 1:52pm
Ah, yes, I think it was discussed here:
@Arnie you can check out that thread, and see if it helps you.