Skip to content

Commit

Permalink
fix(types): remove references to Shader type (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
Methuselah96 authored Dec 23, 2023
1 parent f35f76e commit 8449f8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/postprocessing/ShaderPass.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { Shader, ShaderMaterial, UniformsUtils, WebGLRenderer, WebGLRenderTarget } from 'three'
import { ShaderMaterial, UniformsUtils, WebGLRenderer, WebGLRenderTarget } from 'three'
import { Pass, FullScreenQuad } from './Pass'
import { Defines, IShader, Uniforms } from '../shaders/types'

class ShaderPass extends Pass {
public textureID: string
public uniforms: Shader['uniforms']
public uniforms: Uniforms
public material: ShaderMaterial
public fsQuad: FullScreenQuad

constructor(shader: ShaderMaterial | (Shader & { defines?: Object }), textureID = 'tDiffuse') {
constructor(shader: ShaderMaterial | IShader<Uniforms, Defines | undefined>, textureID = 'tDiffuse') {
super()

this.textureID = textureID
Expand Down
8 changes: 4 additions & 4 deletions src/shaders/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { IUniform, Shader } from 'three'
import type { IUniform } from 'three'

type Defines = { [key: string]: boolean | number | string }
type Uniforms = { [key: string]: IUniform }
export type Defines = { [key: string]: boolean | number | string }
export type Uniforms = { [key: string]: IUniform }

export interface IShader<U extends Uniforms, D extends Defines | undefined = undefined> extends Shader {
export interface IShader<U extends Uniforms, D extends Defines | undefined = undefined> {
defines?: D
fragmentShader: string
uniforms: U
Expand Down

0 comments on commit 8449f8e

Please sign in to comment.