Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Selective SSR on planes #3301

Closed
Ahlecss opened this issue Jul 3, 2024 · 0 comments
Closed

Selective SSR on planes #3301

Ahlecss opened this issue Jul 3, 2024 · 0 comments

Comments

@Ahlecss
Copy link
Contributor

Ahlecss commented Jul 3, 2024

Hey here !
Hope you are doing well,

I’m trying to get a mirror-like effect on the floor for my scene.

I’m using effect composer to use the SSR effect, and so, having a floor that will mirror the lights and the objects on my scene. But the problem is, my objects also get the light. They also have the mirror effect but I don’t want it. They are planeBufferGeometry, with custom shaderMaterial.

I tried with some attributes like receiveShadows, but not working.

I’m maybe searching for a way to select only the meshes on which I want the effect to apply. I saw that in ThreeJS, there is something like “selects” for SSR Pass, is there anything like this in Three Fiber ?

For some code, here is the global Effect Composer

    <EffectComposer disableNormalPass autoClear={true} multisampling={0}>
      {hovered < 6 && <GodRays ref={god} sun={itemsRef.current[hovered]} density={0.4} weight={0.4} exposure={0.4} decay={0.8} blur />}
      <Bloom luminanceThreshold={0} mipmapBlur luminanceSmoothing={0.0} intensity={0.3} />
      <SSR />
    </EffectComposer>

here is the effect of R3F that work well to create the mirror effect

    <ContactShadows resolution={1024} frames={1} position={[0, -1, 0]} scale={15} blur={0.5} opacity={1} far={20} />

here is one of my mesh

      <mesh position={[0, 0, 0.1]}
        ref={el => itemsRef.current[i] = el}
        transparent={true}
        <planeBufferGeometry attach="geometry" args={[3.1 * 1.3, 10 * 1.3, 100, 100]}/>
        <imageFadeMaterial ref={shaderRef} attach="material" tex1={tex1} tex2={tex2} transparent={false} colorSpace={THREE.SRGBColorSpace}/>
      </mesh>

If you have the solution, any idea, or think that it's not the right way to achieve mirror effect, let me know,

Thank you all ! Have a great day !

@pmndrs pmndrs locked and limited conversation to collaborators Aug 10, 2024
@CodyJasonBennett CodyJasonBennett converted this issue into discussion #3328 Aug 10, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant