Skip to content

shaderMaterial: struct support #2440

@aleksanderd

Description

@aleksanderd

Hi!

I trying to pass some structs to uniforms and noticed the shaderMaterial not allow such types. The types can be extended to something like this:

type UniformBaseValue =
  | THREE.Texture
  | THREE.TypedArray
  | THREE.Matrix4
  | THREE.Matrix3
  | THREE.Quaternion
  | THREE.Vector4
  | THREE.Vector3
  | THREE.Vector2
  | THREE.Color
  | MeshBVHUniformStruct // TODO: remove?
  | number
  | boolean
  | null;

type UniformValue = UniformBaseValue | Record<string, UniformBaseValue>;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions