Skip to content

Commit

Permalink
Check if renderer is null
Browse files Browse the repository at this point in the history
Related to #612
  • Loading branch information
vanruesc committed Mar 8, 2024
1 parent d08ba94 commit 0aa5eae
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/effects/BloomEffect.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ export class BloomEffect extends Effect {

this.renderTarget.texture.type = frameBufferType;

if(renderer.outputColorSpace === SRGBColorSpace) {
if(renderer !== null && renderer.outputColorSpace === SRGBColorSpace) {

this.renderTarget.texture.colorSpace = SRGBColorSpace;

Expand Down
2 changes: 1 addition & 1 deletion src/effects/DepthOfFieldEffect.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ export class DepthOfFieldEffect extends Effect {
this.renderTargetFar.texture.type = frameBufferType;
this.renderTargetMasked.texture.type = frameBufferType;

if(renderer.outputColorSpace === SRGBColorSpace) {
if(renderer !== null && renderer.outputColorSpace === SRGBColorSpace) {

this.renderTarget.texture.colorSpace = SRGBColorSpace;
this.renderTargetNear.texture.colorSpace = SRGBColorSpace;
Expand Down
2 changes: 1 addition & 1 deletion src/effects/GodRaysEffect.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ export class GodRaysEffect extends Effect {
this.renderTargetB.texture.type = frameBufferType;
this.renderTargetLight.texture.type = frameBufferType;

if(renderer.outputColorSpace === SRGBColorSpace) {
if(renderer !== null && renderer.outputColorSpace === SRGBColorSpace) {

this.renderTargetA.texture.colorSpace = SRGBColorSpace;
this.renderTargetB.texture.colorSpace = SRGBColorSpace;
Expand Down
4 changes: 2 additions & 2 deletions src/effects/SelectiveBloomEffect.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ export class SelectiveBloomEffect extends BloomEffect {
this.depthPass.initialize(renderer, alpha, frameBufferType);
this.depthMaskPass.initialize(renderer, alpha, frameBufferType);

if(renderer.capabilities.logarithmicDepthBuffer) {
if(renderer !== null && renderer.capabilities.logarithmicDepthBuffer) {

this.depthMaskPass.fullscreenMaterial.defines.LOG_DEPTH = "1";

Expand All @@ -343,7 +343,7 @@ export class SelectiveBloomEffect extends BloomEffect {

this.renderTargetMasked.texture.type = frameBufferType;

if(renderer.outputColorSpace === SRGBColorSpace) {
if(renderer !== null && renderer.outputColorSpace === SRGBColorSpace) {

this.renderTargetMasked.texture.colorSpace = SRGBColorSpace;

Expand Down
2 changes: 1 addition & 1 deletion src/effects/TiltShiftEffect.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export class TiltShiftEffect extends Effect {

this.renderTarget.texture.type = frameBufferType;

if(renderer.outputColorSpace === SRGBColorSpace) {
if(renderer !== null && renderer.outputColorSpace === SRGBColorSpace) {

this.renderTarget.texture.colorSpace = SRGBColorSpace;

Expand Down
8 changes: 6 additions & 2 deletions src/passes/BoxBlurPass.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,11 @@ export class BoxBlurPass extends Pass {

initialize(renderer, alpha, frameBufferType) {

this.blurMaterial.maxVaryingVectors = renderer.capabilities.maxVaryings;
if(renderer !== null) {

this.blurMaterial.maxVaryingVectors = renderer.capabilities.maxVaryings;

}

if(frameBufferType !== undefined) {

Expand All @@ -192,7 +196,7 @@ export class BoxBlurPass extends Pass {

this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1";

} else if(renderer.outputColorSpace === SRGBColorSpace) {
} else if(renderer !== null && renderer.outputColorSpace === SRGBColorSpace) {

this.renderTargetA.texture.colorSpace = SRGBColorSpace;
this.renderTargetB.texture.colorSpace = SRGBColorSpace;
Expand Down
2 changes: 1 addition & 1 deletion src/passes/CopyPass.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export class CopyPass extends Pass {

this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1";

} else if(renderer.outputColorSpace === SRGBColorSpace) {
} else if(renderer !== null && renderer.outputColorSpace === SRGBColorSpace) {

this.renderTarget.texture.colorSpace = SRGBColorSpace;

Expand Down
2 changes: 1 addition & 1 deletion src/passes/GaussianBlurPass.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class GaussianBlurPass extends Pass {
this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1";
this.copyMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1";

} else if(renderer.outputColorSpace === SRGBColorSpace) {
} else if(renderer !== null && renderer.outputColorSpace === SRGBColorSpace) {

this.renderTargetA.texture.colorSpace = SRGBColorSpace;
this.renderTargetB.texture.colorSpace = SRGBColorSpace;
Expand Down
2 changes: 1 addition & 1 deletion src/passes/KawaseBlurPass.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ export class KawaseBlurPass extends Pass {
this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1";
this.copyMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1";

} else if(renderer.outputColorSpace === SRGBColorSpace) {
} else if(renderer !== null && renderer.outputColorSpace === SRGBColorSpace) {

this.renderTargetA.texture.colorSpace = SRGBColorSpace;
this.renderTargetB.texture.colorSpace = SRGBColorSpace;
Expand Down
2 changes: 1 addition & 1 deletion src/passes/MipmapBlurPass.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export class MipmapBlurPass extends Pass {
this.downsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1";
this.upsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1";

} else if(renderer.outputColorSpace === SRGBColorSpace) {
} else if(renderer !== null && renderer.outputColorSpace === SRGBColorSpace) {

for(const mipmap of mipmaps) {

Expand Down

0 comments on commit 0aa5eae

Please sign in to comment.