Skip to content

Commit

Permalink
chore: Move EffectsComposer into TS (#32)
Browse files Browse the repository at this point in the history
* Move FullScreenQuad into class

* Move ShaderPass into TS
 * Convert Pass and ShaderPass to class defs

* Move EffectsComposer into TS

* better typing

* Move EffectComposer to class

* consts and lets instead of var

* Cleanup

* Public/private accessors

* return types

* Move mask function to class
  • Loading branch information
disambiguator authored Mar 17, 2021
1 parent da68934 commit e0cc26c
Show file tree
Hide file tree
Showing 25 changed files with 383 additions and 376 deletions.
4 changes: 2 additions & 2 deletions src/postprocessing/AdaptiveToneMappingPass.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
UniformsUtils,
WebGLRenderTarget,
} from 'three'
import { Pass } from '../postprocessing/Pass'
import { Pass, FullScreenQuad } from '../postprocessing/Pass'
import { CopyShader } from '../shaders/CopyShader'
import { LuminosityShader } from '../shaders/LuminosityShader'
import { ToneMapShader } from '../shaders/ToneMapShader'
Expand Down Expand Up @@ -122,7 +122,7 @@ var AdaptiveToneMappingPass = function (adaptive, resolution) {
blending: NoBlending,
})

this.fsQuad = new Pass.FullScreenQuad(null)
this.fsQuad = new FullScreenQuad(null)
}

AdaptiveToneMappingPass.prototype = Object.assign(Object.create(Pass.prototype), {
Expand Down
6 changes: 3 additions & 3 deletions src/postprocessing/AfterimagePass.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
UniformsUtils,
WebGLRenderTarget,
} from 'three'
import { Pass } from '../postprocessing/Pass'
import { Pass, FullScreenQuad } from '../postprocessing/Pass'
import { AfterimageShader } from '../shaders/AfterimageShader'

var AfterimagePass = function (damp) {
Expand Down Expand Up @@ -39,10 +39,10 @@ var AfterimagePass = function (damp) {
fragmentShader: this.shader.fragmentShader,
})

this.compFsQuad = new Pass.FullScreenQuad(this.shaderMaterial)
this.compFsQuad = new FullScreenQuad(this.shaderMaterial)

var material = new MeshBasicMaterial()
this.copyFsQuad = new Pass.FullScreenQuad(material)
this.copyFsQuad = new FullScreenQuad(material)
}

AfterimagePass.prototype = Object.assign(Object.create(Pass.prototype), {
Expand Down
4 changes: 2 additions & 2 deletions src/postprocessing/BloomPass.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
Vector2,
WebGLRenderTarget,
} from 'three'
import { Pass } from '../postprocessing/Pass'
import { Pass, FullScreenQuad } from '../postprocessing/Pass'
import { CopyShader } from '../shaders/CopyShader'
import { ConvolutionShader } from '../shaders/ConvolutionShader'

Expand Down Expand Up @@ -73,7 +73,7 @@ var BloomPass = function (strength, kernelSize, sigma, resolution) {

this.needsSwap = false

this.fsQuad = new Pass.FullScreenQuad(null)
this.fsQuad = new FullScreenQuad(null)
}

BloomPass.prototype = Object.assign(Object.create(Pass.prototype), {
Expand Down
4 changes: 2 additions & 2 deletions src/postprocessing/BokehPass.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
UniformsUtils,
WebGLRenderTarget,
} from 'three'
import { Pass } from '../postprocessing/Pass'
import { Pass, FullScreenQuad } from '../postprocessing/Pass'
import { BokehShader } from '../shaders/BokehShader'

/**
Expand Down Expand Up @@ -72,7 +72,7 @@ var BokehPass = function (scene, camera, params) {
this.uniforms = bokehUniforms
this.needsSwap = false

this.fsQuad = new Pass.FullScreenQuad(this.materialBokeh)
this.fsQuad = new FullScreenQuad(this.materialBokeh)

this._oldClearColor = new Color()
}
Expand Down
4 changes: 2 additions & 2 deletions src/postprocessing/DotScreenPass.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ShaderMaterial, UniformsUtils } from 'three'
import { Pass } from '../postprocessing/Pass'
import { Pass, FullScreenQuad } from '../postprocessing/Pass'
import { DotScreenShader } from '../shaders/DotScreenShader'

var DotScreenPass = function (center, angle, scale) {
Expand All @@ -21,7 +21,7 @@ var DotScreenPass = function (center, angle, scale) {
fragmentShader: shader.fragmentShader,
})

this.fsQuad = new Pass.FullScreenQuad(this.material)
this.fsQuad = new FullScreenQuad(this.material)
}

DotScreenPass.prototype = Object.assign(Object.create(Pass.prototype), {
Expand Down
194 changes: 0 additions & 194 deletions src/postprocessing/EffectComposer.js

This file was deleted.

Loading

1 comment on commit e0cc26c

@vercel
Copy link

@vercel vercel bot commented on e0cc26c Mar 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.