Character rendering issue when creating a mirror with render texture and camera

I created a mirror with render texture and camera. Whenever there’s an Animator on the character, the character will only render the hair and there’s a mask overlay on the rest of the body. Additional context: the hair is rendered in transparent pass while the rest of the body are in opaque pass. Would appreciate any leads on why this happened and how I can fix this. Thanks so much!
mirror_rendering.png

Original Post on Discord

by user 1052295380936691712

Hi, which needle engine version are you using?

Do you think you could provide a repro or send a bug report (via menu item Needle Engine/Report a bug)

yes! will do!

by user 1052295380936691712

I submitted one!

by user 1052295380936691712

Thank you, will take a look at it tomorrow!

thanks!

by user 1052295380936691712

Hi I wonder if you received my bug report? Thank you!

by user 1052295380936691712

Hi, yes we received it but didn’t get to it yet. I’ll let you know when we have an update

awesome! thanks a lot!

by user 1052295380936691712

Cool scene

hi @tianxu your mirror camera has a negative X scale. this might be causing the issue

hi thank you! I did flip it back and it didnt really help!

by user 1052295380936691712

I just realized that you have two x flips

the parent is also flipped

20230720-180143_Frontline_Demo_-_Google_Chrome-logo.mp4

make sure you don’t flip any axis on the cameras :slightly_smiling_face:
image.png

that being said: i also made a core change to explictly clear depth and color. According to the three.js docs that would happen automatically but perhaps they changed it or there’s another reason. I’ll check why

but with both these changes the rendering looks like in the video above (no negative camera scales and clear depth/color in our RT implementation)

^ actually this is with x = -1 still on the camera + camera parent so it is just due to the fact that the depth buffer wasn’t cleared automatically. That will be fixed in the next update!