Skip to content

Instantly share code, notes, and snippets.

@stalgiag
Created October 29, 2019 00:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stalgiag/90ce8daebfdbdb92f6baa946ff6eb728 to your computer and use it in GitHub Desktop.
Save stalgiag/90ce8daebfdbdb92f6baa946ff6eb728 to your computer and use it in GitHub Desktop.
this._renderState = {
lighting: {
ambient: {
colors: []
},
specular: {
colors: [1, 1, 1]
},
directional: {
directions: [],
colors: {
diffuse: [],
specular: []
}
},
point: {
positions: [],
colors: {
diffuse: [],
specular: []
}
},
spot: {
positions: [],
directions: [],
angle: [],
conc: [],
colors: {
diffuse: [],
specular: []
}
}
},
shaders: {
default: {
light: undefined,
immediate: undefined,
normal: undefined,
color: undefined,
point: undefined
},
user: {
fill: undefined,
stroke: undefined,
point: undefined
}
},
stroke: {
color: [0, 0, 0, 1],
weight: 1,
perspective: 1
},
matrices: {
modelView: new p5.Matrix(),
projection: new p5.Matrix(),
normals: new p5.Matrix('mat3')
}
}
/*********************** VS ********************/
/**********************************************/
this.ambientLightColors = [];
this.specularColors = [1, 1, 1];
this.directionalLightDirections = [];
this.directionalLightDiffuseColors = [];
this.directionalLightSpecularColors = [];
this.pointLightPositions = [];
this.pointLightDiffuseColors = [];
this.pointLightSpecularColors = [];
this.spotLightPositions = [];
this.spotLightDirections = [];
this.spotLightDiffuseColors = [];
this.spotLightSpecularColors = [];
this.spotLightAngle = [];
this.spotLightConc = [];
this.curFillColor = this._cachedFillStyle = [1, 1, 1, 1];
this.curStrokeColor = this._cachedStrokeStyle = [0, 0, 0, 1];
this.uMVMatrix = new p5.Matrix();
this.uPMatrix = new p5.Matrix();
this.uNMatrix = new p5.Matrix('mat3');
this._defaultLightShader = undefined;
this._defaultImmediateModeShader = undefined;
this._defaultNormalShader = undefined;
this._defaultColorShader = undefined;
this._defaultPointShader = undefined;
this.userFillShader = undefined;
this.userStrokeShader = undefined;
this.userPointShader = undefined;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment