|
@@ -10,7 +10,7 @@ module BABYLON {
|
|
@serialize()
|
|
@serialize()
|
|
public _name: string;
|
|
public _name: string;
|
|
|
|
|
|
- constructor(engine: Engine, name: string) {
|
|
|
|
|
|
+ constructor(private engine: Engine, name: string) {
|
|
this._name = name;
|
|
this._name = name;
|
|
|
|
|
|
this._renderEffects = {};
|
|
this._renderEffects = {};
|
|
@@ -143,6 +143,19 @@ module BABYLON {
|
|
this._renderEffectsForIsolatedPass = new Array<PostProcessRenderEffect>();
|
|
this._renderEffectsForIsolatedPass = new Array<PostProcessRenderEffect>();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ protected _enableMSAAOnFirstPostProcess():boolean{
|
|
|
|
+ // Set samples of the very first post process to 4 to enable native anti-aliasing in browsers that support webGL 2.0 (See: https://github.com/BabylonJS/Babylon.js/issues/3754)
|
|
|
|
+ var effectKeys = Object.keys(this._renderEffects);
|
|
|
|
+ if(this.engine.webGLVersion >= 2 && effectKeys.length > 0){
|
|
|
|
+ var postProcesses = this._renderEffects[effectKeys[0]].getPostProcesses();
|
|
|
|
+ if(postProcesses){
|
|
|
|
+ postProcesses[0].samples = 4;
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
public dispose() {
|
|
public dispose() {
|
|
// Must be implemented by children
|
|
// Must be implemented by children
|
|
}
|
|
}
|