|
@@ -95,7 +95,6 @@ export class GeometryBufferRenderer {
|
|
protected _effect: Effect;
|
|
protected _effect: Effect;
|
|
protected _cachedDefines: string;
|
|
protected _cachedDefines: string;
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* @hidden
|
|
* @hidden
|
|
* Sets up internal structures to share outputs with PrePassRenderer
|
|
* Sets up internal structures to share outputs with PrePassRenderer
|
|
@@ -167,7 +166,7 @@ export class GeometryBufferRenderer {
|
|
/**
|
|
/**
|
|
* @hidden
|
|
* @hidden
|
|
* Replaces the first texture which is hard coded as a depth texture in the geometry buffer
|
|
* Replaces the first texture which is hard coded as a depth texture in the geometry buffer
|
|
- * Useful when linking textures of the prepass renderer
|
|
|
|
|
|
+ * Useful when linking textures of the prepass renderer
|
|
*/
|
|
*/
|
|
public linkInternalTexture(internalTexture: InternalTexture) {
|
|
public linkInternalTexture(internalTexture: InternalTexture) {
|
|
this._multiRenderTarget._texture = internalTexture;
|
|
this._multiRenderTarget._texture = internalTexture;
|
|
@@ -225,7 +224,7 @@ export class GeometryBufferRenderer {
|
|
// PrePass handles index and texture links
|
|
// PrePass handles index and texture links
|
|
if (!this._linkedWithPrePass) {
|
|
if (!this._linkedWithPrePass) {
|
|
this.dispose();
|
|
this.dispose();
|
|
- this._createRenderTargets();
|
|
|
|
|
|
+ this._createRenderTargets();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -248,7 +247,7 @@ export class GeometryBufferRenderer {
|
|
|
|
|
|
if (!this._linkedWithPrePass) {
|
|
if (!this._linkedWithPrePass) {
|
|
this.dispose();
|
|
this.dispose();
|
|
- this._createRenderTargets();
|
|
|
|
|
|
+ this._createRenderTargets();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -267,7 +266,7 @@ export class GeometryBufferRenderer {
|
|
|
|
|
|
if (!this._linkedWithPrePass) {
|
|
if (!this._linkedWithPrePass) {
|
|
this.dispose();
|
|
this.dispose();
|
|
- this._createRenderTargets();
|
|
|
|
|
|
+ this._createRenderTargets();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -363,7 +362,10 @@ export class GeometryBufferRenderer {
|
|
// PrePass
|
|
// PrePass
|
|
if (this._linkedWithPrePass) {
|
|
if (this._linkedWithPrePass) {
|
|
defines.push("#define PREPASS");
|
|
defines.push("#define PREPASS");
|
|
- defines.push("#define DEPTHNORMAL_INDEX " + this._depthNormalIndex);
|
|
|
|
|
|
+ if (this._depthNormalIndex !== -1) {
|
|
|
|
+ defines.push("#define DEPTHNORMAL_INDEX " + this._depthNormalIndex);
|
|
|
|
+ defines.push("#define PREPASS_DEPTHNORMAL");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// Buffers
|
|
// Buffers
|
|
@@ -499,7 +501,7 @@ export class GeometryBufferRenderer {
|
|
count++;
|
|
count++;
|
|
}
|
|
}
|
|
|
|
|
|
- return count
|
|
|
|
|
|
+ return count;
|
|
}
|
|
}
|
|
|
|
|
|
protected _createRenderTargets(): void {
|
|
protected _createRenderTargets(): void {
|