Skip to content

SSGI Instacned & GPUComputationRenderer support #45

Description

@momentchan

I used GPUComputationRenderer to compute the position and velocity for particles and save them as texture, and pass them to instancedMesh for rendering.

<instancedMesh>
       <boxGeometry args={[0.2, 0.2, 0.6]}>
               <instancedBufferAttribute attach="attributes-uvs" args={[uvs, 3]} />
        </boxGeometry>
        <ThreeCustomShaderMaterial/>
</instancedMesh>

In the vertex shader of the material for instancedMesh, I did something like this:

 void main() {
         vec3 pos = texture2D(positionTex, uvs.xy).xyz;
         csm_PositionRaw =  projectionMatrix * modelViewMatrix * vec4( position + pos, 1.0 );
},

When I apply the SSGI, all particles become bunch of boxes in the origin, and the positions I modified with the positionTex are not correctly reflected.
Is it some kind of the limit of SSGI?

螢幕擷取畫面 2024-04-13 153801
螢幕擷取畫面 2024-04-13 153920

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions