Sha256: 3b6d2f105203e119c96e9f80a73d201220189b664f3ddaf227a2ff60fac95d02

Contents?: true

Size: 1005 Bytes

Versions: 21

Compression:

Stored size: 1005 Bytes

Contents

#ifdef USE_SKINNING

	uniform mat4 bindMatrix;
	uniform mat4 bindMatrixInverse;

	#ifdef BONE_TEXTURE

		uniform sampler2D boneTexture;
		uniform int boneTextureWidth;
		uniform int boneTextureHeight;

		mat4 getBoneMatrix( const in float i ) {

			float j = i * 4.0;
			float x = mod( j, float( boneTextureWidth ) );
			float y = floor( j / float( boneTextureWidth ) );

			float dx = 1.0 / float( boneTextureWidth );
			float dy = 1.0 / float( boneTextureHeight );

			y = dy * ( y + 0.5 );

			vec4 v1 = texture( boneTexture, vec2( dx * ( x + 0.5 ), y ) );
			vec4 v2 = texture( boneTexture, vec2( dx * ( x + 1.5 ), y ) );
			vec4 v3 = texture( boneTexture, vec2( dx * ( x + 2.5 ), y ) );
			vec4 v4 = texture( boneTexture, vec2( dx * ( x + 3.5 ), y ) );

			mat4 bone = mat4( v1, v2, v3, v4 );

			return bone;

		}

	#else

		uniform mat4 boneGlobalMatrices[ MAX_BONES ];

		mat4 getBoneMatrix( const in float i ) {

			mat4 bone = boneGlobalMatrices[ int(i) ];
			return bone;

		}

	#endif

#endif

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
mittsu-opengl-0.5.1 lib/mittsu/opengl/shader/chunks/skinning_pars_vertex.glsl
mittsu-0.4.1 lib/mittsu/renderers/shaders/shader_chunk/skinning_pars_vertex.glsl
mittsu-opengl-0.5.0 lib/mittsu/opengl/shader/chunks/skinning_pars_vertex.glsl
mittsu-0.4.0 lib/mittsu/renderers/shaders/shader_chunk/skinning_pars_vertex.glsl
mittsu-0.3.3 lib/mittsu/renderers/shaders/shader_chunk/skinning_pars_vertex.glsl
mittsu-0.3.2 lib/mittsu/renderers/shaders/shader_chunk/skinning_pars_vertex.glsl
mittsu-0.3.1 lib/mittsu/renderers/shaders/shader_chunk/skinning_pars_vertex.glsl
mittsu-0.3.0 lib/mittsu/renderers/shaders/shader_chunk/skinning_pars_vertex.glsl
mittsu-0.2.4 lib/mittsu/renderers/shaders/shader_chunk/skinning_pars_vertex.glsl
mittsu-0.2.3 lib/mittsu/renderers/shaders/shader_chunk/skinning_pars_vertex.glsl
mittsu-0.2.2 lib/mittsu/renderers/shaders/shader_chunk/skinning_pars_vertex.glsl
mittsu-0.2.1 lib/mittsu/renderers/shaders/shader_chunk/skinning_pars_vertex.glsl
mittsu-0.2.0 lib/mittsu/renderers/shaders/shader_chunk/skinning_pars_vertex.glsl
mittsu-0.1.7 lib/mittsu/renderers/shaders/shader_chunk/skinning_pars_vertex.glsl
mittsu-0.1.6 lib/mittsu/renderers/shaders/shader_chunk/skinning_pars_vertex.glsl
mittsu-0.1.5 lib/mittsu/renderers/shaders/shader_chunk/skinning_pars_vertex.glsl
mittsu-0.1.4 lib/mittsu/renderers/shaders/shader_chunk/skinning_pars_vertex.glsl
mittsu-0.1.3 lib/mittsu/renderers/shaders/shader_chunk/skinning_pars_vertex.glsl
mittsu-0.1.2 lib/mittsu/renderers/shaders/shader_chunk/skinning_pars_vertex.glsl
mittsu-0.1.1 lib/mittsu/renderers/shaders/shader_chunk/skinning_pars_vertex.glsl