Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
b63a2a31
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b63a2a31
编写于
7月 18, 2017
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
5740f920
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
727 addition
and
741 deletion
+727
-741
build/three.js
build/three.js
+16
-23
build/three.min.js
build/three.min.js
+695
-695
build/three.module.js
build/three.module.js
+16
-23
未找到文件。
build/three.js
浏览文件 @
b63a2a31
...
@@ -6375,10 +6375,7 @@
...
@@ -6375,10 +6375,7 @@
* @author alteredq / http://alteredqualia.com/
* @author alteredq / http://alteredqualia.com/
*/
*/
function WebGLFlareRenderer( renderer, flares ) {
function WebGLFlareRenderer( renderer, gl, state, capabilities ) {
var gl = renderer.context;
var state = renderer.state;
var vertexBuffer, elementBuffer;
var vertexBuffer, elementBuffer;
var shader, program, attributes, uniforms;
var shader, program, attributes, uniforms;
...
@@ -6549,7 +6546,7 @@
...
@@ -6549,7 +6546,7 @@
* reads these back and calculates occlusion.
* reads these back and calculates occlusion.
*/
*/
this.render = function ( scene, camera, viewport ) {
this.render = function (
flares,
scene, camera, viewport ) {
if ( flares.length === 0 ) return;
if ( flares.length === 0 ) return;
...
@@ -6734,7 +6731,7 @@
...
@@ -6734,7 +6731,7 @@
var fragmentShader = gl.createShader( gl.FRAGMENT_SHADER );
var fragmentShader = gl.createShader( gl.FRAGMENT_SHADER );
var vertexShader = gl.createShader( gl.VERTEX_SHADER );
var vertexShader = gl.createShader( gl.VERTEX_SHADER );
var prefix = "precision " +
renderer.getPrecision()
+ " float;\n";
var prefix = "precision " +
capabilities.precision
+ " float;\n";
gl.shaderSource( fragmentShader, prefix + shader.fragmentShader );
gl.shaderSource( fragmentShader, prefix + shader.fragmentShader );
gl.shaderSource( vertexShader, prefix + shader.vertexShader );
gl.shaderSource( vertexShader, prefix + shader.vertexShader );
...
@@ -6773,10 +6770,7 @@
...
@@ -6773,10 +6770,7 @@
* @author alteredq / http://alteredqualia.com/
* @author alteredq / http://alteredqualia.com/
*/
*/
function WebGLSpriteRenderer( renderer, sprites ) {
function WebGLSpriteRenderer( renderer, gl, state, capabilities ) {
var gl = renderer.context;
var state = renderer.state;
var vertexBuffer, elementBuffer;
var vertexBuffer, elementBuffer;
var program, attributes, uniforms;
var program, attributes, uniforms;
...
@@ -6854,7 +6848,7 @@
...
@@ -6854,7 +6848,7 @@
}
}
this.render = function ( scene, camera ) {
this.render = function ( s
prites, s
cene, camera ) {
if ( sprites.length === 0 ) return;
if ( sprites.length === 0 ) return;
...
@@ -7027,7 +7021,7 @@
...
@@ -7027,7 +7021,7 @@
gl.shaderSource( vertexShader, [
gl.shaderSource( vertexShader, [
'precision ' +
renderer.getPrecision()
+ ' float;',
'precision ' +
capabilities.precision
+ ' float;',
'#define SHADER_NAME ' + 'SpriteMaterial',
'#define SHADER_NAME ' + 'SpriteMaterial',
...
@@ -7067,7 +7061,7 @@
...
@@ -7067,7 +7061,7 @@
gl.shaderSource( fragmentShader, [
gl.shaderSource( fragmentShader, [
'precision ' +
renderer.getPrecision()
+ ' float;',
'precision ' +
capabilities.precision
+ ' float;',
'#define SHADER_NAME ' + 'SpriteMaterial',
'#define SHADER_NAME ' + 'SpriteMaterial',
...
@@ -9097,7 +9091,7 @@
...
@@ -9097,7 +9091,7 @@
* @author mrdoob / http://mrdoob.com/
* @author mrdoob / http://mrdoob.com/
*/
*/
function WebGLShadowMap( _renderer, _shadows, _objects,
capabilities
) {
function WebGLShadowMap( _renderer, _shadows, _objects,
maxTextureSize
) {
var _gl = _renderer.context,
var _gl = _renderer.context,
_state = _renderer.state,
_state = _renderer.state,
...
@@ -9105,7 +9099,7 @@
...
@@ -9105,7 +9099,7 @@
_projScreenMatrix = new Matrix4(),
_projScreenMatrix = new Matrix4(),
_shadowMapSize = new Vector2(),
_shadowMapSize = new Vector2(),
_maxShadowMapSize = new Vector2(
capabilities.maxTextureSize, capabilities.
maxTextureSize ),
_maxShadowMapSize = new Vector2(
maxTextureSize,
maxTextureSize ),
_lookTarget = new Vector3(),
_lookTarget = new Vector3(),
_lightPositionWorld = new Vector3(),
_lightPositionWorld = new Vector3(),
...
@@ -20790,6 +20784,7 @@
...
@@ -20790,6 +20784,7 @@
var programCache, renderLists;
var programCache, renderLists;
var background, bufferRenderer, indexedBufferRenderer;
var background, bufferRenderer, indexedBufferRenderer;
var flareRenderer, spriteRenderer;
function initGLContext() {
function initGLContext() {
...
@@ -20828,6 +20823,9 @@
...
@@ -20828,6 +20823,9 @@
bufferRenderer = new WebGLBufferRenderer( _gl, extensions, _infoRender );
bufferRenderer = new WebGLBufferRenderer( _gl, extensions, _infoRender );
indexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, _infoRender );
indexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, _infoRender );
flareRenderer = new WebGLFlareRenderer( _this, _gl, state, capabilities );
spriteRenderer = new WebGLSpriteRenderer( _this, _gl, state, capabilities );
_this.info.programs = programCache.programs;
_this.info.programs = programCache.programs;
_this.context = _gl;
_this.context = _gl;
...
@@ -20849,15 +20847,10 @@
...
@@ -20849,15 +20847,10 @@
// shadow map
// shadow map
var shadowMap = new WebGLShadowMap(
this, shadowsArray, objects, capabilities
);
var shadowMap = new WebGLShadowMap(
_this, shadowsArray, objects, capabilities.maxTextureSize
);
this.shadowMap = shadowMap;
this.shadowMap = shadowMap;
//
var spriteRenderer = new WebGLSpriteRenderer( this, spritesArray );
var flareRenderer = new WebGLFlareRenderer( this, flaresArray );
// API
// API
this.getContext = function () {
this.getContext = function () {
...
@@ -21728,8 +21721,8 @@
...
@@ -21728,8 +21721,8 @@
// custom renderers
// custom renderers
spriteRenderer.render( scene, camera );
spriteRenderer.render( s
pritesArray, s
cene, camera );
flareRenderer.render( scene, camera, _currentViewport );
flareRenderer.render(
flaresArray,
scene, camera, _currentViewport );
// Generate mipmap if we're using any kind of mipmap filtering
// Generate mipmap if we're using any kind of mipmap filtering
...
...
build/three.min.js
浏览文件 @
b63a2a31
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
build/three.module.js
浏览文件 @
b63a2a31
...
@@ -6369,10 +6369,7 @@ Object.assign( Box2.prototype, {
...
@@ -6369,10 +6369,7 @@ Object.assign( Box2.prototype, {
* @author alteredq / http://alteredqualia.com/
* @author alteredq / http://alteredqualia.com/
*/
*/
function WebGLFlareRenderer( renderer, flares ) {
function WebGLFlareRenderer( renderer, gl, state, capabilities ) {
var gl = renderer.context;
var state = renderer.state;
var vertexBuffer, elementBuffer;
var vertexBuffer, elementBuffer;
var shader, program, attributes, uniforms;
var shader, program, attributes, uniforms;
...
@@ -6543,7 +6540,7 @@ function WebGLFlareRenderer( renderer, flares ) {
...
@@ -6543,7 +6540,7 @@ function WebGLFlareRenderer( renderer, flares ) {
* reads these back and calculates occlusion.
* reads these back and calculates occlusion.
*/
*/
this.render = function ( scene, camera, viewport ) {
this.render = function (
flares,
scene, camera, viewport ) {
if ( flares.length === 0 ) return;
if ( flares.length === 0 ) return;
...
@@ -6728,7 +6725,7 @@ function WebGLFlareRenderer( renderer, flares ) {
...
@@ -6728,7 +6725,7 @@ function WebGLFlareRenderer( renderer, flares ) {
var fragmentShader = gl.createShader( gl.FRAGMENT_SHADER );
var fragmentShader = gl.createShader( gl.FRAGMENT_SHADER );
var vertexShader = gl.createShader( gl.VERTEX_SHADER );
var vertexShader = gl.createShader( gl.VERTEX_SHADER );
var prefix = "precision " +
renderer.getPrecision()
+ " float;\n";
var prefix = "precision " +
capabilities.precision
+ " float;\n";
gl.shaderSource( fragmentShader, prefix + shader.fragmentShader );
gl.shaderSource( fragmentShader, prefix + shader.fragmentShader );
gl.shaderSource( vertexShader, prefix + shader.vertexShader );
gl.shaderSource( vertexShader, prefix + shader.vertexShader );
...
@@ -6767,10 +6764,7 @@ CanvasTexture.prototype.constructor = CanvasTexture;
...
@@ -6767,10 +6764,7 @@ CanvasTexture.prototype.constructor = CanvasTexture;
* @author alteredq / http://alteredqualia.com/
* @author alteredq / http://alteredqualia.com/
*/
*/
function WebGLSpriteRenderer( renderer, sprites ) {
function WebGLSpriteRenderer( renderer, gl, state, capabilities ) {
var gl = renderer.context;
var state = renderer.state;
var vertexBuffer, elementBuffer;
var vertexBuffer, elementBuffer;
var program, attributes, uniforms;
var program, attributes, uniforms;
...
@@ -6848,7 +6842,7 @@ function WebGLSpriteRenderer( renderer, sprites ) {
...
@@ -6848,7 +6842,7 @@ function WebGLSpriteRenderer( renderer, sprites ) {
}
}
this.render = function ( scene, camera ) {
this.render = function ( s
prites, s
cene, camera ) {
if ( sprites.length === 0 ) return;
if ( sprites.length === 0 ) return;
...
@@ -7021,7 +7015,7 @@ function WebGLSpriteRenderer( renderer, sprites ) {
...
@@ -7021,7 +7015,7 @@ function WebGLSpriteRenderer( renderer, sprites ) {
gl.shaderSource( vertexShader, [
gl.shaderSource( vertexShader, [
'precision ' +
renderer.getPrecision()
+ ' float;',
'precision ' +
capabilities.precision
+ ' float;',
'#define SHADER_NAME ' + 'SpriteMaterial',
'#define SHADER_NAME ' + 'SpriteMaterial',
...
@@ -7061,7 +7055,7 @@ function WebGLSpriteRenderer( renderer, sprites ) {
...
@@ -7061,7 +7055,7 @@ function WebGLSpriteRenderer( renderer, sprites ) {
gl.shaderSource( fragmentShader, [
gl.shaderSource( fragmentShader, [
'precision ' +
renderer.getPrecision()
+ ' float;',
'precision ' +
capabilities.precision
+ ' float;',
'#define SHADER_NAME ' + 'SpriteMaterial',
'#define SHADER_NAME ' + 'SpriteMaterial',
...
@@ -9091,7 +9085,7 @@ Object.assign( Frustum.prototype, {
...
@@ -9091,7 +9085,7 @@ Object.assign( Frustum.prototype, {
* @author mrdoob / http://mrdoob.com/
* @author mrdoob / http://mrdoob.com/
*/
*/
function WebGLShadowMap( _renderer, _shadows, _objects,
capabilities
) {
function WebGLShadowMap( _renderer, _shadows, _objects,
maxTextureSize
) {
var _gl = _renderer.context,
var _gl = _renderer.context,
_state = _renderer.state,
_state = _renderer.state,
...
@@ -9099,7 +9093,7 @@ function WebGLShadowMap( _renderer, _shadows, _objects, capabilities ) {
...
@@ -9099,7 +9093,7 @@ function WebGLShadowMap( _renderer, _shadows, _objects, capabilities ) {
_projScreenMatrix = new Matrix4(),
_projScreenMatrix = new Matrix4(),
_shadowMapSize = new Vector2(),
_shadowMapSize = new Vector2(),
_maxShadowMapSize = new Vector2(
capabilities.maxTextureSize, capabilities.
maxTextureSize ),
_maxShadowMapSize = new Vector2(
maxTextureSize,
maxTextureSize ),
_lookTarget = new Vector3(),
_lookTarget = new Vector3(),
_lightPositionWorld = new Vector3(),
_lightPositionWorld = new Vector3(),
...
@@ -20784,6 +20778,7 @@ function WebGLRenderer( parameters ) {
...
@@ -20784,6 +20778,7 @@ function WebGLRenderer( parameters ) {
var programCache, renderLists;
var programCache, renderLists;
var background, bufferRenderer, indexedBufferRenderer;
var background, bufferRenderer, indexedBufferRenderer;
var flareRenderer, spriteRenderer;
function initGLContext() {
function initGLContext() {
...
@@ -20822,6 +20817,9 @@ function WebGLRenderer( parameters ) {
...
@@ -20822,6 +20817,9 @@ function WebGLRenderer( parameters ) {
bufferRenderer = new WebGLBufferRenderer( _gl, extensions, _infoRender );
bufferRenderer = new WebGLBufferRenderer( _gl, extensions, _infoRender );
indexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, _infoRender );
indexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, _infoRender );
flareRenderer = new WebGLFlareRenderer( _this, _gl, state, capabilities );
spriteRenderer = new WebGLSpriteRenderer( _this, _gl, state, capabilities );
_this.info.programs = programCache.programs;
_this.info.programs = programCache.programs;
_this.context = _gl;
_this.context = _gl;
...
@@ -20843,15 +20841,10 @@ function WebGLRenderer( parameters ) {
...
@@ -20843,15 +20841,10 @@ function WebGLRenderer( parameters ) {
// shadow map
// shadow map
var shadowMap = new WebGLShadowMap(
this, shadowsArray, objects, capabilities
);
var shadowMap = new WebGLShadowMap(
_this, shadowsArray, objects, capabilities.maxTextureSize
);
this.shadowMap = shadowMap;
this.shadowMap = shadowMap;
//
var spriteRenderer = new WebGLSpriteRenderer( this, spritesArray );
var flareRenderer = new WebGLFlareRenderer( this, flaresArray );
// API
// API
this.getContext = function () {
this.getContext = function () {
...
@@ -21722,8 +21715,8 @@ function WebGLRenderer( parameters ) {
...
@@ -21722,8 +21715,8 @@ function WebGLRenderer( parameters ) {
// custom renderers
// custom renderers
spriteRenderer.render( scene, camera );
spriteRenderer.render( s
pritesArray, s
cene, camera );
flareRenderer.render( scene, camera, _currentViewport );
flareRenderer.render(
flaresArray,
scene, camera, _currentViewport );
// Generate mipmap if we're using any kind of mipmap filtering
// Generate mipmap if we're using any kind of mipmap filtering
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录