提交 d87224fa 编写于 作者: M Mikael Emtinger

Put back the pink square method to allow for partial screen border occlusion in opengl

上级 50b6745a
......@@ -3536,11 +3536,11 @@ THREE.WebGLRenderer = function ( parameters ) {
// screen cull
//if( _lensFlare.hasVertexTexture ||
if( screenPositionPixels[ 0 ] > 0 &&
if( _lensFlare.hasVertexTexture ||
( screenPositionPixels[ 0 ] > 0 &&
screenPositionPixels[ 0 ] < _viewportWidth &&
screenPositionPixels[ 1 ] > 0 &&
screenPositionPixels[ 1 ] < _viewportHeight ) {
screenPositionPixels[ 1 ] < _viewportHeight )) {
// save current RGB to temp texture
......
......@@ -593,17 +593,20 @@ THREE.ShaderLib = {
"if( renderType == 2 ) {",
"float visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 )).a +",
"texture2D( occlusionMap, vec2( 0.5, 0.1 )).a +",
"texture2D( occlusionMap, vec2( 0.9, 0.1 )).a +",
"texture2D( occlusionMap, vec2( 0.9, 0.5 )).a +",
"texture2D( occlusionMap, vec2( 0.9, 0.9 )).a +",
"texture2D( occlusionMap, vec2( 0.5, 0.9 )).a +",
"texture2D( occlusionMap, vec2( 0.1, 0.9 )).a +",
"texture2D( occlusionMap, vec2( 0.1, 0.5 )).a +",
"texture2D( occlusionMap, vec2( 0.5, 0.5 )).a;",
"vVisibility = ( 1.0 - visibility / 9.0 );",
"vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 )) +",
"texture2D( occlusionMap, vec2( 0.5, 0.1 )) +",
"texture2D( occlusionMap, vec2( 0.9, 0.1 )) +",
"texture2D( occlusionMap, vec2( 0.9, 0.5 )) +",
"texture2D( occlusionMap, vec2( 0.9, 0.9 )) +",
"texture2D( occlusionMap, vec2( 0.5, 0.9 )) +",
"texture2D( occlusionMap, vec2( 0.1, 0.9 )) +",
"texture2D( occlusionMap, vec2( 0.1, 0.5 )) +",
"texture2D( occlusionMap, vec2( 0.5, 0.5 ));",
"vVisibility = ( visibility.r / 9.0 ) *",
"( 1.0 - visibility.g / 9.0 ) *",
"( visibility.b / 9.0 ) *",
"( 1.0 - visibility.a / 9.0 );",
"pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;",
"pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;",
......@@ -633,8 +636,7 @@ THREE.ShaderLib = {
"if( renderType == 0 ) {",
"gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );",
// "gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );",
"gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );",
// restore
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册