Search Unity

Frustum Culling -unity doesn't cull based on the position calculated in vertex shader

Discussion in 'Shaders' started by psomgeorg, Aug 29, 2019.

  1. psomgeorg

    psomgeorg

    Joined:
    Mar 16, 2019
    Posts:
    99
    I want to instantiate some particles in an area(via script) and move them via a vertex shader. However unity doesn't know the real position of the particles which was calculated in the vertex shader and it culls according to the past position or the position the particles where instantiated. The result is that particles get drawn in the position i want, however unity culls them if i happen to not look in the direction unity "thinks" they are. Is there any way to let unity know the real position of the particles. Also disabling culling or making the bounds too large might not work for me because i do want this in VR and i am about to have about 2 million particles over the course of time, so frustum culling is important for performance reasons. Also i use apparently gpu instancing