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
6060 static const gpu::Element POSITION_ELEMENT { gpu::VEC3, gpu::FLOAT, gpu::XYZ };
6161 static const gpu::Element NORMAL_ELEMENT { gpu::VEC3, gpu::FLOAT, gpu::XYZ };
6262 static const gpu::Element COLOR_ELEMENT { gpu::VEC4, gpu::NUINT8, gpu::RGBA };
63−static const gpu::Element TEXCOORD4_ELEMENT { gpu::VEC4, gpu::HALF, gpu::XYZW };
63+static const gpu::Element TEXCOORD4_ELEMENT { gpu::VEC4, gpu::FLOAT, gpu::XYZW };
6464
6565 static gpu::Stream::FormatPointer SOLID_STREAM_FORMAT;
6666 static gpu::Stream::FormatPointer INSTANCED_SOLID_STREAM_FORMAT;
@@ -620,7 +620,7 @@ void GeometryCache::renderWireShapeInstances(gpu::Batch& batch, Shape shape, siz · 553 unmodified lines
620620 }
621621
622622 void 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) {
624624 gpu::BufferView colorView(colorBuffer, COLOR_ELEMENT);
625625 gpu::BufferView texCoord2View(fadeBuffer1, TEXCOORD4_ELEMENT);
626626 gpu::BufferView texCoord3View(fadeBuffer2, TEXCOORD4_ELEMENT);
@@ -2102,7 +2102,7 @@ void renderFadeInstances(RenderArgs* args, gpu::Batch& batch, const glm::vec4& c · 1475 unmodified lines
21022102 const glm::vec3& fadeNoiseOffset, const glm::vec3& fadeBaseOffset, const glm::vec3& fadeBaseInvSize, bool isWire,
21032103 const render::ShapePipelinePointer& pipeline, GeometryCache::Shape shape) {
21042104 // 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));
21062106
21072107 // Add color to named buffer
21082108 {