-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Post processing #5615
Post processing #5615
Changes from 1 commit
834e8cb
da6035f
9c8a6d6
a70d8a2
4ad7479
82600fe
d4cc375
c5dccd4
b6ed72c
93ef755
266cc7b
1faf224
bebc134
2f0d796
b087d6a
e803419
a553d45
213b2c3
0784d5e
66c2da7
014e660
2fbf49f
7d6bf80
7b8e19c
64e6153
1715976
7ce73d0
0855fbe
2cd80db
1fe6b81
16ca244
ee72f6a
689ce04
0f16fbb
1d3ed16
db94906
3b7e984
9b48d51
e974825
51e2a0c
1c5161a
d2adb27
5f60ba2
ec358a0
c70bf3d
8b4e0ea
4132972
6c89895
5939ac1
50c579a
7da72b4
939bf28
e9e450e
a1385cf
f5b368f
fed5c55
f30c858
0a8823f
3fe047c
c244e73
c9d3a33
500df66
b514464
4818d78
2cb380f
94f618c
2d54010
5835edc
f4c3e8d
9686e47
f6e906e
5b3da89
6137119
3532edc
54e68f8
125581d
6fbd1fa
ef8ae7b
4b1cd51
ae37bfc
25203b4
aaffaa6
e36a52a
5d96caf
c4e892d
28ad66b
78d5242
112f968
500660d
1bbe961
3715bdb
317d63d
400c5fc
55ee446
ee6353a
ac71370
4eba88d
06b7fb2
beac0b5
035e297
bf5ce51
957620a
fcc3ded
fb3f15a
b2f2f35
a17343f
9fd5ab3
36eb23a
1f8bd16
4b05583
9cf5469
408f5ca
49b5d87
8a5bef0
55ae1a1
6682e22
f6d3654
a68418c
1928b7f
b9b8e0c
8d6ad17
6e53e43
5e11e9e
4468f92
84e242a
3534c15
12c79e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,8 +161,6 @@ define([ | |
this._enabled = true; | ||
} | ||
|
||
var depthTextureRegex = /uniform\s+sampler2D\s+depthTexture/g; | ||
|
||
defineProperties(PostProcessStage.prototype, { | ||
/** | ||
* Determines if this post-process stage is ready to be executed. A stage is only executed when both <code>ready</code> | ||
|
@@ -335,25 +333,32 @@ define([ | |
} | ||
return undefined; | ||
} | ||
}, | ||
/** | ||
* Whether or not this post process stage requires a depth texture. If <code>true</code> and the WEBGL_depth_texture | ||
* extension is unavailable, this stage will not execute. | ||
* | ||
* @memberof PostProcessStage.prototype | ||
* @type {Boolean} | ||
* @readonly | ||
* | ||
* @see {Context#depthTexture} | ||
* @see {@link http://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/|WEBGL_depth_texture} | ||
*/ | ||
requiresDepthTexture : { | ||
get : function() { | ||
return depthTextureRegex.test(this._fragmentShader); | ||
} | ||
} | ||
}); | ||
|
||
var depthTextureRegex = /uniform\s+sampler2D\s+depthTexture/g; | ||
|
||
/** | ||
* Whether or not this post process stage is supported. | ||
* <p> | ||
* A post process stage is not supported when it requires a depth texture and the WEBGL_depth_texture extension is not | ||
* supported. | ||
* </p> | ||
* | ||
* @param {Context} context The context. | ||
* @return {Boolean} Whether this post process stage is supported. | ||
* | ||
* @see {Context#depthTexture} | ||
* @see {@link http://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/|WEBGL_depth_texture} | ||
*/ | ||
PostProcessStage.prototype.isSupported = function(context) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are a few areas in the post processing code that check if ao is enabled by checking if depth textures are supported. Those areas should call this function instead. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
//>>includeStart('debug', pragmas.debug); | ||
Check.typeOf.object('context', context); | ||
//>>includeEnd('debug'); | ||
|
||
return !depthTextureRegex.test(this._fragmentShader) || context.depthTexture; | ||
}; | ||
|
||
function getUniformValueGetterAndSetter(stage, uniforms, name) { | ||
var currentValue = uniforms[name]; | ||
if (typeof currentValue === 'string' || currentValue instanceof HTMLCanvasElement || currentValue instanceof HTMLImageElement || | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's part of the public API it should probably take
scene
instead.Annoyingly, there will probably need to be a duplicate function that takes
context
, for internal use.