History

Instancing work, second pass

Bradley Austin Davis committed 11 years ago

Commit e024d231 parent ba5109c33 files · +935 −877Browse files

Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 33 files). Show all

Unified · Split

interface/src/avatar/SkeletonModel.cpp+10−12
@@ -639,27 +639,25 @@ void SkeletonModel::renderBoundingCollisionShapes(gpu::Batch& batch, float alpha · 638 unmodified lines
639639
640640 auto geometryCache = DependencyManager::get<GeometryCache>();
641641 auto deferredLighting = DependencyManager::get<DeferredLightingEffect>();
642− Transform transform; // = Transform();
643−
644642 // draw a blue sphere at the capsule top point
645643 glm::vec3 topPoint = _translation + _boundingCapsuleLocalOffset + (0.5f * _boundingCapsuleHeight) * glm::vec3(0.0f, 1.0f, 0.0f);
646− transform.setTranslation(topPoint);
647− batch.setModelTransform(transform);
648− deferredLighting->bindSimpleProgram(batch);
649− geometryCache->renderSphere(batch, _boundingCapsuleRadius, BALL_SUBDIVISIONS, BALL_SUBDIVISIONS,
650− glm::vec4(0.6f, 0.6f, 0.8f, alpha));
644+
645+ deferredLighting->renderSolidSphereInstance(batch,
646+ Transform().setTranslation(topPoint).postScale(_boundingCapsuleRadius * 2.0),
647+ glm::vec4(0.6f, 0.6f, 0.8f, alpha));
651648
652649 // draw a yellow sphere at the capsule bottom point
653650 glm::vec3 bottomPoint = topPoint - glm::vec3(0.0f, _boundingCapsuleHeight, 0.0f);
654651 glm::vec3 axis = topPoint - bottomPoint;
655− transform.setTranslation(bottomPoint);
656− batch.setModelTransform(transform);
657− deferredLighting->bindSimpleProgram(batch);
658− geometryCache->renderSphere(batch, _boundingCapsuleRadius, BALL_SUBDIVISIONS, BALL_SUBDIVISIONS,
659− glm::vec4(0.8f, 0.8f, 0.6f, alpha));
652+
653+ deferredLighting->renderSolidSphereInstance(batch,
654+ Transform().setTranslation(bottomPoint).postScale(_boundingCapsuleRadius * 2.0),
655+ glm::vec4(0.8f, 0.8f, 0.6f, alpha));
660656
661657 // draw a green cylinder between the two points
662658 glm::vec3 origin(0.0f);
659+ batch.setModelTransform(Transform().setTranslation(bottomPoint));
660+ deferredLighting->bindSimpleProgram(batch);
663661 Avatar::renderJointConnectingCone(batch, origin, axis, _boundingCapsuleRadius, _boundingCapsuleRadius,
664662 glm::vec4(0.6f, 0.8f, 0.6f, alpha));
665663 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t