提交 230d39e4 编写于 作者: A alteredq

Made it possible to enforce use of uniforms instead of float texture for bones.

上级 c5d85fe6
此差异已折叠。
此差异已折叠。
......@@ -165,7 +165,7 @@
for( z = 0; z < gridz; z ++ ) {
buffalo = new THREE.SkinnedMesh( geometry, material );
buffalo = new THREE.SkinnedMesh( geometry, material, false );
//buffalo.doubleSided = true;
......
......@@ -3,13 +3,13 @@
* @author alteredq / http://alteredqualia.com/
*/
THREE.SkinnedMesh = function ( geometry, material ) {
THREE.SkinnedMesh = function ( geometry, material, useVertexTexture ) {
THREE.Mesh.call( this, geometry, material );
//
this.useVertexTexture = true;
this.useVertexTexture = useVertexTexture !== undefined ? useVertexTexture : true;
// init bones
......
......@@ -4526,6 +4526,7 @@ THREE.WebGLRenderer = function ( parameters ) {
skinning: material.skinning,
maxBones: maxBones,
useVertexTexture: _supportsBoneTextures && object.useVertexTexture,
boneTextureWidth: object.boneTextureWidth,
boneTextureHeight: object.boneTextureHeight,
......@@ -4799,7 +4800,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( material.skinning ) {
if ( _supportsBoneTextures ) {
if ( _supportsBoneTextures && object.useVertexTexture ) {
if ( p_uniforms.boneTexture !== null ) {
......@@ -5698,7 +5699,7 @@ THREE.WebGLRenderer = function ( parameters ) {
parameters.vertexColors ? "#define USE_COLOR" : "",
parameters.skinning ? "#define USE_SKINNING" : "",
_supportsBoneTextures ? "#define BONE_TEXTURE" : "",
parameters.useVertexTexture ? "#define BONE_TEXTURE" : "",
parameters.boneTextureWidth ? "#define N_BONE_PIXEL_X " + parameters.boneTextureWidth.toFixed( 1 ) : "",
parameters.boneTextureHeight ? "#define N_BONE_PIXEL_Y " + parameters.boneTextureHeight.toFixed( 1 ) : "",
......@@ -5847,7 +5848,7 @@ THREE.WebGLRenderer = function ( parameters ) {
];
if ( _supportsBoneTextures ) {
if ( parameters.useVertexTexture ) {
identifiers.push( 'boneTexture' );
......@@ -6390,7 +6391,7 @@ THREE.WebGLRenderer = function ( parameters ) {
function allocateBones ( object ) {
if ( _supportsBoneTextures ) {
if ( _supportsBoneTextures && object.useVertexTexture ) {
return 1024;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册