|
@@ -172,6 +172,8 @@ export class Effect implements IDisposable {
|
|
|
private _vertexSourceCodeOverride: string = "";
|
|
|
private _fragmentSourceCodeOverride: string = "";
|
|
|
private _transformFeedbackVaryings: Nullable<string[]> = null;
|
|
|
+ private _rawVertexSourceCode: string = "";
|
|
|
+ private _rawFragmentSourceCode: string = "";
|
|
|
/**
|
|
|
* Compiled shader to webGL program.
|
|
|
* @hidden
|
|
@@ -286,7 +288,9 @@ export class Effect implements IDisposable {
|
|
|
};
|
|
|
|
|
|
this._loadShader(vertexSource, "Vertex", "", (vertexCode) => {
|
|
|
+ this._rawVertexSourceCode = vertexCode;
|
|
|
this._loadShader(fragmentSource, "Fragment", "Pixel", (fragmentCode) => {
|
|
|
+ this._rawFragmentSourceCode = fragmentCode;
|
|
|
ShaderProcessor.Process(vertexCode, processorOptions, (migratedVertexCode) => {
|
|
|
if (processFinalCode) {
|
|
|
migratedVertexCode = processFinalCode("vertex", migratedVertexCode);
|
|
@@ -560,6 +564,20 @@ export class Effect implements IDisposable {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Gets the vertex shader source code before it has been processed by the preprocessor
|
|
|
+ */
|
|
|
+ public get rawVertexSourceCode(): string {
|
|
|
+ return this._rawVertexSourceCode;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Gets the fragment shader source code before it has been processed by the preprocessor
|
|
|
+ */
|
|
|
+ public get rawFragmentSourceCode(): string {
|
|
|
+ return this._rawFragmentSourceCode;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* Recompiles the webGL program
|
|
|
* @param vertexSourceCode The source code for the vertex shader.
|
|
|
* @param fragmentSourceCode The source code for the fragment shader.
|