|
@@ -9,7 +9,6 @@ import { Logger } from '../Misc/logger';
|
|
|
import { _DevTools } from '../Misc/devTools';
|
|
|
import { Color4 } from "../Maths/math.color";
|
|
|
import { PrePassEffectConfiguration } from "./prePassEffectConfiguration";
|
|
|
-
|
|
|
/**
|
|
|
* Renders a pre pass of the scene
|
|
|
* This means every mesh in the scene will be rendered to a render target texture
|
|
@@ -22,69 +21,33 @@ export class PrePassRenderer {
|
|
|
throw _DevTools.WarnImport("PrePassRendererSceneComponent");
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Constant used to retrieve the irradiance texture index in the textures array
|
|
|
- * using getIndex(PrePassRenderer.IRRADIANCE_TEXTURE_TYPE)
|
|
|
- */
|
|
|
- public static readonly IRRADIANCE_TEXTURE_TYPE = 0;
|
|
|
- /**
|
|
|
- * Constant used to retrieve the position texture index in the textures array
|
|
|
- * using getIndex(PrePassRenderer.POSITION_TEXTURE_INDEX)
|
|
|
- */
|
|
|
- public static readonly POSITION_TEXTURE_TYPE = 1;
|
|
|
- /**
|
|
|
- * Constant used to retrieve the velocity texture index in the textures array
|
|
|
- * using getIndex(PrePassRenderer.VELOCITY_TEXTURE_INDEX)
|
|
|
- */
|
|
|
- public static readonly VELOCITY_TEXTURE_TYPE = 2;
|
|
|
- /**
|
|
|
- * Constant used to retrieve the reflectivity texture index in the textures array
|
|
|
- * using the getIndex(PrePassRenderer.REFLECTIVITY_TEXTURE_TYPE)
|
|
|
- */
|
|
|
- public static readonly REFLECTIVITY_TEXTURE_TYPE = 3;
|
|
|
- /**
|
|
|
- * Constant used to retrieve the lit color texture index in the textures array
|
|
|
- * using the getIndex(PrePassRenderer.COLOR_TEXTURE_TYPE)
|
|
|
- */
|
|
|
- public static readonly COLOR_TEXTURE_TYPE = 4;
|
|
|
- /**
|
|
|
- * Constant used to retrieve depth + normal index in the textures array
|
|
|
- * using the getIndex(PrePassRenderer.DEPTHNORMAL_TEXTURE_TYPE)
|
|
|
- */
|
|
|
- public static readonly DEPTHNORMAL_TEXTURE_TYPE = 5;
|
|
|
- /**
|
|
|
- * Constant used to retrieve albedo index in the textures array
|
|
|
- * using the getIndex(PrePassRenderer.ALBEDO_TEXTURE_TYPE)
|
|
|
- */
|
|
|
- public static readonly ALBEDO_TEXTURE_TYPE = 6;
|
|
|
-
|
|
|
private _textureFormats = [
|
|
|
{
|
|
|
- type: PrePassRenderer.IRRADIANCE_TEXTURE_TYPE,
|
|
|
+ type: Constants.PREPASS_IRRADIANCE_TEXTURE_TYPE,
|
|
|
format: Constants.TEXTURETYPE_HALF_FLOAT,
|
|
|
},
|
|
|
{
|
|
|
- type: PrePassRenderer.POSITION_TEXTURE_TYPE,
|
|
|
+ type: Constants.PREPASS_POSITION_TEXTURE_TYPE,
|
|
|
format: Constants.TEXTURETYPE_HALF_FLOAT,
|
|
|
},
|
|
|
{
|
|
|
- type: PrePassRenderer.VELOCITY_TEXTURE_TYPE,
|
|
|
+ type: Constants.PREPASS_VELOCITY_TEXTURE_TYPE,
|
|
|
format: Constants.TEXTURETYPE_HALF_FLOAT,
|
|
|
},
|
|
|
{
|
|
|
- type: PrePassRenderer.REFLECTIVITY_TEXTURE_TYPE,
|
|
|
+ type: Constants.PREPASS_REFLECTIVITY_TEXTURE_TYPE,
|
|
|
format: Constants.TEXTURETYPE_UNSIGNED_INT,
|
|
|
},
|
|
|
{
|
|
|
- type: PrePassRenderer.COLOR_TEXTURE_TYPE,
|
|
|
+ type: Constants.PREPASS_COLOR_TEXTURE_TYPE,
|
|
|
format: Constants.TEXTURETYPE_HALF_FLOAT,
|
|
|
},
|
|
|
{
|
|
|
- type: PrePassRenderer.DEPTHNORMAL_TEXTURE_TYPE,
|
|
|
+ type: Constants.PREPASS_DEPTHNORMAL_TEXTURE_TYPE,
|
|
|
format: Constants.TEXTURETYPE_HALF_FLOAT,
|
|
|
},
|
|
|
{
|
|
|
- type: PrePassRenderer.ALBEDO_TEXTURE_TYPE,
|
|
|
+ type: Constants.PREPASS_ALBEDO_TEXTURE_TYPE,
|
|
|
format: Constants.TEXTURETYPE_UNSIGNED_INT,
|
|
|
},
|
|
|
];
|
|
@@ -390,8 +353,8 @@ export class PrePassRenderer {
|
|
|
this._textureIndices[this._textureFormats[i].type] = -1;
|
|
|
}
|
|
|
|
|
|
- this._textureIndices[PrePassRenderer.COLOR_TEXTURE_TYPE] = 0;
|
|
|
- this._mrtLayout = [PrePassRenderer.COLOR_TEXTURE_TYPE];
|
|
|
+ this._textureIndices[Constants.PREPASS_COLOR_TEXTURE_TYPE] = 0;
|
|
|
+ this._mrtLayout = [Constants.PREPASS_COLOR_TEXTURE_TYPE];
|
|
|
this._mrtFormats = [Constants.TEXTURETYPE_HALF_FLOAT];
|
|
|
this.mrtCount = 1;
|
|
|
}
|