History

Removed glColor reset hack in MeshPartPayload and replaced it by a reset of the color attribute to white in the execution of the setInputFormat command of the various GLBackends

Olivier Prat committed 8 years ago

Commit bd666401 parent 7ea1f3b11 files · +75 −19Browse files

Showing the changes to libraries/render-utils/src/GeometryCache.cpp (1 of 11 files). Show all

Unified · Split

libraries/render-utils/src/GeometryCache.cpp+30−0
@@ -760,6 +760,20 @@ void GeometryCache::renderWireShape(gpu::Batch& batch, Shape shape) { · 759 unmodified lines
760 _shapes[shape].drawWire(batch);760 _shapes[shape].drawWire(batch);
761}761}
762 762
763void GeometryCache::renderShape(gpu::Batch& batch, Shape shape, const glm::vec4& color) {
764 batch.setInputFormat(getSolidStreamFormat());
765 // Color must be set after input format
766 batch._glColor4f(color.r, color.g, color.b, color.a);
767 _shapes[shape].draw(batch);
768}
769
770void GeometryCache::renderWireShape(gpu::Batch& batch, Shape shape, const glm::vec4& color) {
771 batch.setInputFormat(getSolidStreamFormat());
772 // Color must be set after input format
773 batch._glColor4f(color.r, color.g, color.b, color.a);
774 _shapes[shape].drawWire(batch);
775}
776
763void setupBatchInstance(gpu::Batch& batch, gpu::BufferPointer colorBuffer) {777void setupBatchInstance(gpu::Batch& batch, gpu::BufferPointer colorBuffer) {
764 gpu::BufferView colorView(colorBuffer, COLOR_ELEMENT);778 gpu::BufferView colorView(colorBuffer, COLOR_ELEMENT);
765 batch.setInputBuffer(gpu::Stream::COLOR, colorView);779 batch.setInputBuffer(gpu::Stream::COLOR, colorView);
@@ -811,6 +825,14 @@ void GeometryCache::renderWireCube(gpu::Batch& batch) { · 45 unmodified lines
811 renderWireShape(batch, Cube);825 renderWireShape(batch, Cube);
812}826}
813 827
828void GeometryCache::renderCube(gpu::Batch& batch, const glm::vec4& color) {
829 renderShape(batch, Cube, color);
830}
831
832void GeometryCache::renderWireCube(gpu::Batch& batch, const glm::vec4& color) {
833 renderWireShape(batch, Cube, color);
834}
835
814void GeometryCache::renderSphere(gpu::Batch& batch) {836void GeometryCache::renderSphere(gpu::Batch& batch) {
815 renderShape(batch, Sphere);837 renderShape(batch, Sphere);
816}838}
@@ -819,6 +841,14 @@ void GeometryCache::renderWireSphere(gpu::Batch& batch) { · 2 unmodified lines
819 renderWireShape(batch, Sphere);841 renderWireShape(batch, Sphere);
820}842}
821 843
844void GeometryCache::renderSphere(gpu::Batch& batch, const glm::vec4& color) {
845 renderShape(batch, Sphere, color);
846}
847
848void GeometryCache::renderWireSphere(gpu::Batch& batch, const glm::vec4& color) {
849 renderWireShape(batch, Sphere, color);
850}
851
822void GeometryCache::renderGrid(gpu::Batch& batch, const glm::vec2& minCorner, const glm::vec2& maxCorner,852void GeometryCache::renderGrid(gpu::Batch& batch, const glm::vec2& minCorner, const glm::vec2& maxCorner,
823 int majorRows, int majorCols, float majorEdge,853 int majorRows, int majorCols, float majorEdge,
824 int minorRows, int minorCols, float minorEdge,854 int minorRows, int minorCols, float minorEdge,

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