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

EffectComposer.passes is not an array #303

Open
kigawa01 opened this issue Nov 16, 2024 · 0 comments
Open

EffectComposer.passes is not an array #303

kigawa01 opened this issue Nov 16, 2024 · 0 comments

Comments

@kigawa01
Copy link

When you run the code below, the following log will be output.
Originally an array should be output.
It is normal when children is undefined.

code

"use client"
import React, {useRef} from "react";
import {extend, useThree} from "@react-three/fiber";
import {EffectComposer, RenderPass, ShaderPass} from "three-stdlib";

extend({EffectComposer, RenderPass, ShaderPass})

export default function Effect(
  {}: object,
) {
  const composerRef = useRef<EffectComposer>(null)
  const {gl, scene, camera} = useThree()

  console.debug(composerRef.current?.passes)

  return (
    <effectComposer ref={composerRef} args={[gl]}>
      <renderPass attach="passes" args={[scene, camera]}/>
    </effectComposer>
  )
}

log

Download the React DevTools for a better development experience: https://reactjs.org/link/react-devtools react-dom.development.js:38560
undefined Effect.tsx:14:10
Object { enabled: true, needsSwap: false, clear: true, renderToScreen: false, scene: {…}, camera: {…}, overrideMaterial: undefined, clearColor: undefined, clearAlpha: 0, clearDepth: false, … }
Effect.tsx:14:10

version

  • three: 0.170.0
  • three-stdlib: 2.34.0
  • @react-three/postprocessing: 2.16.3
  • @react-three/drei: 9.115.0
  • @react-three/fiber: 8.17.10
  • @types/three: 0.170.0

sample

https://github.com/kigawa01/test-three/tree/test/effect-composer/1

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