pokepetter / ursina

A game engine powered by python and panda3d.
https://pokepetter.github.io/ursina/
MIT License
2.23k stars 328 forks source link

FirstPersonController sees through entities because of shaders #679

Closed valmme closed 6 months ago

valmme commented 6 months ago

I make the game and to create a player, I use the FirstPersonController class. I also use the shader pixelation_shader. But with shaders there is a problem. I made a room in the game out of rectangular entities, but if I use any shader, the player can see through these walls when he get too close. When I remove the import of this shader, the bug is corrected изображение

pokepetter commented 6 months ago

This is due to the near clip plane. Assigning a shader to the camera will set this to 1, since shaders using the depth texture will break otherwise. You can change the near clip plane this by setting camera.clip_plane_near

valmme commented 6 months ago

@pokepetter Thanks