Skip to content

Commit

Permalink
Merge pull request #4757 from AnalyticalGraphicsInc/rtc-fix
Browse files Browse the repository at this point in the history
Check for CESIUM_RTC_MODELVIEW in ModelInstanceCollection
  • Loading branch information
pjcozzi authored Dec 15, 2016
2 parents e4b1286 + d1783ad commit fdf4239
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Source/Scene/ModelInstanceCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@ define([
var instancedUniformsByProgram = {};
collection._instancedUniformsByProgram = instancedUniformsByProgram;

var modelSemantics = ['MODEL', 'MODELVIEW', 'MODELVIEWPROJECTION', 'MODELINVERSE', 'MODELVIEWINVERSE', 'MODELVIEWPROJECTIONINVERSE', 'MODELINVERSETRANSPOSE', 'MODELVIEWINVERSETRANSPOSE'];
var supportedSemantics = ['MODELVIEW', 'MODELVIEWPROJECTION', 'MODELVIEWINVERSETRANSPOSE'];
// When using CESIUM_RTC_MODELVIEW the CESIUM_RTC center is ignored. Instances are always rendered relative-to-center.
var modelSemantics = ['MODEL', 'MODELVIEW', 'CESIUM_RTC_MODELVIEW', 'MODELVIEWPROJECTION', 'MODELINVERSE', 'MODELVIEWINVERSE', 'MODELVIEWPROJECTIONINVERSE', 'MODELINVERSETRANSPOSE', 'MODELVIEWINVERSETRANSPOSE'];
var supportedSemantics = ['MODELVIEW', 'CESIUM_RTC_MODELVIEW', 'MODELVIEWPROJECTION', 'MODELVIEWINVERSETRANSPOSE'];

var gltf = collection._model.gltf;
var techniques = gltf.techniques;
Expand Down Expand Up @@ -253,7 +254,7 @@ define([
if (instancedUniforms.hasOwnProperty(uniform)) {
var semantic = instancedUniforms[uniform];
var varName;
if (semantic === 'MODELVIEW') {
if (semantic === 'MODELVIEW' || semantic === 'CESIUM_RTC_MODELVIEW') {
varName = 'czm_instanced_modelView';
} else if (semantic === 'MODELVIEWPROJECTION') {
varName = 'czm_instanced_modelViewProjection';
Expand Down

0 comments on commit fdf4239

Please sign in to comment.