Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/renderers/webgl/WebGLShadowMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ function WebGLShadowMap( _renderer, _objects, maxTextureSize ) {

}

function getDepthMaterialVariant( useMorphing, useSkinning ) {
function getDepthMaterialVariant( useMorphing, useSkinning, useInstancing ) {

var index = useMorphing << 0 | useSkinning << 1;
var index = useMorphing << 0 | useSkinning << 1 | useInstancing << 2;

var material = _depthMaterials[ index ];

Expand All @@ -254,9 +254,9 @@ function WebGLShadowMap( _renderer, _objects, maxTextureSize ) {

}

function getDistanceMaterialVariant( useMorphing, useSkinning ) {
function getDistanceMaterialVariant( useMorphing, useSkinning, useInstancing ) {

var index = useMorphing << 0 | useSkinning << 1;
var index = useMorphing << 0 | useSkinning << 1 | useInstancing << 2;

var material = _distanceMaterials[ index ];

Expand Down Expand Up @@ -327,7 +327,9 @@ function WebGLShadowMap( _renderer, _objects, maxTextureSize ) {

}

result = getMaterialVariant( useMorphing, useSkinning );
var useInstancing = object.isInstancedMesh === true;

result = getMaterialVariant( useMorphing, useSkinning, useInstancing );

} else {

Expand Down