[Notice of Holidays]
Please note that our staff will not be available from 2024/Dec/28 - 2025/Jan/5 JST.
The Live2D Creators Forum will remain open during the holidays.
Submissions that require a response will be answered after we reopen for business.
Please note that it will take longer than usual to respond to your request.
Shadows of Live2D Model - Unity
Hi,
I would like to know if there is any way of getting a shadow projection for a Live2D model in Unity. Ej: a Live2D canvas and a plane behind that receive the shadow of the model (its shape).
I have tried using differents types of shaders without success. Not sure if exists a simple way.
A possible solution could be get the pixels data after live2d.draw() of the associated GameObject call and then paste those pixels to a transparent texture. After that, change the texture color to "black" and use that textue on a plane placed as shadow would be.
I don´t know if that could be a possible solution. Nevertheless, I don´t know how to get pixels data after a draw() call or exactly how to do all operation.
Does anyone know how to implement this functionality? Or any help?
Thanks
Regards
0 ·
Comments
Did you give render textures (http://docs.unity3d.com/Manual/class-RenderTexture.html) a try?
You could draw your live2d model onto a render texture, attach that texture to a quad and first use that quad for rendering the model. After that, you could "project" the render texture onto the background plane to fake the shadow.
This might currently be the "easiest" way to achieve the effect you want. I could try to write up a small example but that would be in a few days.
Thanks a lot for your response. That solution works great.
I have to check the performance of getting more cameras in my scene.
Thanks!