History

Working fade parameters through instanced draw calls

Olivier Prat committed 9 years ago

Commit 3316be41 parent d055b1a7 files · +22 −34Browse files

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

Unified · Split

libraries/render-utils/src/GeometryCache.cpp+3−3
@@ -60,7 +60,7 @@ static const int VERTICES_PER_TRIANGLE = 3; · 59 unmodified lines
60static const gpu::Element POSITION_ELEMENT { gpu::VEC3, gpu::FLOAT, gpu::XYZ };60static const gpu::Element POSITION_ELEMENT { gpu::VEC3, gpu::FLOAT, gpu::XYZ };
61static const gpu::Element NORMAL_ELEMENT { gpu::VEC3, gpu::FLOAT, gpu::XYZ };61static const gpu::Element NORMAL_ELEMENT { gpu::VEC3, gpu::FLOAT, gpu::XYZ };
62static const gpu::Element COLOR_ELEMENT { gpu::VEC4, gpu::NUINT8, gpu::RGBA };62static const gpu::Element COLOR_ELEMENT { gpu::VEC4, gpu::NUINT8, gpu::RGBA };
63static const gpu::Element TEXCOORD4_ELEMENT { gpu::VEC4, gpu::HALF, gpu::XYZW };63static const gpu::Element TEXCOORD4_ELEMENT { gpu::VEC4, gpu::FLOAT, gpu::XYZW };
64 64
65static gpu::Stream::FormatPointer SOLID_STREAM_FORMAT;65static gpu::Stream::FormatPointer SOLID_STREAM_FORMAT;
66static gpu::Stream::FormatPointer INSTANCED_SOLID_STREAM_FORMAT;66static gpu::Stream::FormatPointer INSTANCED_SOLID_STREAM_FORMAT;
@@ -620,7 +620,7 @@ void GeometryCache::renderWireShapeInstances(gpu::Batch& batch, Shape shape, siz · 553 unmodified lines
620}620}
621 621
622void setupBatchFadeInstance(gpu::Batch& batch, gpu::BufferPointer colorBuffer, 622void setupBatchFadeInstance(gpu::Batch& batch, gpu::BufferPointer colorBuffer,
623 gpu::BufferPointer& fadeBuffer1, gpu::BufferPointer& fadeBuffer2, gpu::BufferPointer& fadeBuffer3) {623 gpu::BufferPointer fadeBuffer1, gpu::BufferPointer fadeBuffer2, gpu::BufferPointer fadeBuffer3) {
624 gpu::BufferView colorView(colorBuffer, COLOR_ELEMENT);624 gpu::BufferView colorView(colorBuffer, COLOR_ELEMENT);
625 gpu::BufferView texCoord2View(fadeBuffer1, TEXCOORD4_ELEMENT);625 gpu::BufferView texCoord2View(fadeBuffer1, TEXCOORD4_ELEMENT);
626 gpu::BufferView texCoord3View(fadeBuffer2, TEXCOORD4_ELEMENT);626 gpu::BufferView texCoord3View(fadeBuffer2, TEXCOORD4_ELEMENT);
@@ -2102,7 +2102,7 @@ void renderFadeInstances(RenderArgs* args, gpu::Batch& batch, const glm::vec4& c · 1475 unmodified lines
2102 const glm::vec3& fadeNoiseOffset, const glm::vec3& fadeBaseOffset, const glm::vec3& fadeBaseInvSize, bool isWire,2102 const glm::vec3& fadeNoiseOffset, const glm::vec3& fadeBaseOffset, const glm::vec3& fadeBaseInvSize, bool isWire,
2103 const render::ShapePipelinePointer& pipeline, GeometryCache::Shape shape) {2103 const render::ShapePipelinePointer& pipeline, GeometryCache::Shape shape) {
2104 // Add pipeline to name2104 // Add pipeline to name
2105 std::string instanceName = (isWire ? "wire_fade_shapes_" : "solid_fade_shapes_") + std::to_string(shape) + "_" + std::to_string(std::hash<render::ShapePipelinePointer>()(pipeline));2105 std::string instanceName = (isWire ? "wire_shapes_" : "solid_shapes_") + std::to_string(shape) + "_" + std::to_string(std::hash<render::ShapePipelinePointer>()(pipeline));
2106 2106
2107 // Add color to named buffer2107 // Add color to named buffer
2108 {2108 {