Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSGI Instacned & GPUComputationRenderer support #45

Open
momentchan opened this issue Apr 13, 2024 · 0 comments
Open

SSGI Instacned & GPUComputationRenderer support #45

momentchan opened this issue Apr 13, 2024 · 0 comments

Comments

@momentchan
Copy link

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

@momentchan momentchan changed the title SSGI Instacned & FBO support SSGI Instacned & GPUComputationRenderer support Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant