Skip to content

Selective SSR on planes #3301

@Ahlecss

Description

@Ahlecss

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 !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions