mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 08:56:25 +02:00
fix auto casts, offset
This commit is contained in:
parent
f27263cc6a
commit
be95d324cc
5 changed files with 11 additions and 11 deletions
|
@ -337,7 +337,7 @@ void MaterialEntityRenderer::doRender(RenderArgs* args) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw!
|
// Draw!
|
||||||
auto compactColor = 0xFFFFFFFF;
|
const uint32_t compactColor = 0xFFFFFFFF;
|
||||||
_colorBuffer->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
_colorBuffer->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
||||||
DependencyManager::get<GeometryCache>()->renderShape(batch, GeometryCache::Shape::Sphere, _colorBuffer);
|
DependencyManager::get<GeometryCache>()->renderShape(batch, GeometryCache::Shape::Sphere, _colorBuffer);
|
||||||
} else {
|
} else {
|
||||||
|
@ -347,7 +347,7 @@ void MaterialEntityRenderer::doRender(RenderArgs* args) {
|
||||||
proceduralDrawMaterial->prepare(batch, transform.getTranslation(), transform.getScale(),
|
proceduralDrawMaterial->prepare(batch, transform.getTranslation(), transform.getScale(),
|
||||||
transform.getRotation(), _created, ProceduralProgramKey(outColor.a < 1.0f));
|
transform.getRotation(), _created, ProceduralProgramKey(outColor.a < 1.0f));
|
||||||
|
|
||||||
auto compactColor = GeometryCache::toCompactColor(glm::vec4(outColor));
|
const uint32_t compactColor = GeometryCache::toCompactColor(glm::vec4(outColor));
|
||||||
_colorBuffer->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
_colorBuffer->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
||||||
if (render::ShapeKey(args->_globalShapeKey).isWireframe() || _primitiveMode == PrimitiveMode::LINES) {
|
if (render::ShapeKey(args->_globalShapeKey).isWireframe() || _primitiveMode == PrimitiveMode::LINES) {
|
||||||
DependencyManager::get<GeometryCache>()->renderWireShape(batch, GeometryCache::Shape::Sphere, _colorBuffer);
|
DependencyManager::get<GeometryCache>()->renderWireShape(batch, GeometryCache::Shape::Sphere, _colorBuffer);
|
||||||
|
|
|
@ -131,7 +131,7 @@ void ShapeEntityRenderer::doRender(RenderArgs* args) {
|
||||||
procedural->prepare(batch, transform.getTranslation(), transform.getScale(), transform.getRotation(), _created, ProceduralProgramKey(outColor.a < 1.0f));
|
procedural->prepare(batch, transform.getTranslation(), transform.getScale(), transform.getRotation(), _created, ProceduralProgramKey(outColor.a < 1.0f));
|
||||||
});
|
});
|
||||||
|
|
||||||
auto compactColor = GeometryCache::toCompactColor(glm::vec4(outColor));
|
const uint32_t compactColor = GeometryCache::toCompactColor(glm::vec4(outColor));
|
||||||
_colorBuffer->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
_colorBuffer->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
||||||
if (wireframe) {
|
if (wireframe) {
|
||||||
geometryCache->renderWireShape(batch, geometryShape, _colorBuffer);
|
geometryCache->renderWireShape(batch, geometryShape, _colorBuffer);
|
||||||
|
@ -151,7 +151,7 @@ void ShapeEntityRenderer::doRender(RenderArgs* args) {
|
||||||
geometryCache->renderSolidShapeInstance(args, batch, geometryShape, outColor, pipeline);
|
geometryCache->renderSolidShapeInstance(args, batch, geometryShape, outColor, pipeline);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
auto compactColor = GeometryCache::toCompactColor(glm::vec4(outColor));
|
const uint32_t compactColor = GeometryCache::toCompactColor(glm::vec4(outColor));
|
||||||
_colorBuffer->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
_colorBuffer->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
||||||
if (wireframe) {
|
if (wireframe) {
|
||||||
geometryCache->renderWireShape(batch, geometryShape, _colorBuffer);
|
geometryCache->renderWireShape(batch, geometryShape, _colorBuffer);
|
||||||
|
@ -164,7 +164,7 @@ void ShapeEntityRenderer::doRender(RenderArgs* args) {
|
||||||
args->_details._materialSwitches++;
|
args->_details._materialSwitches++;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto compactColor = GeometryCache::toCompactColor(glm::vec4(outColor));
|
const uint32_t compactColor = GeometryCache::toCompactColor(glm::vec4(outColor));
|
||||||
_colorBuffer->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
_colorBuffer->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
||||||
geometryCache->renderShape(batch, geometryShape, _colorBuffer);
|
geometryCache->renderShape(batch, geometryShape, _colorBuffer);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ Mesh::Mesh() :
|
||||||
_vertexBuffer(gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::XYZ)),
|
_vertexBuffer(gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::XYZ)),
|
||||||
_indexBuffer(gpu::Element(gpu::SCALAR, gpu::UINT32, gpu::INDEX)),
|
_indexBuffer(gpu::Element(gpu::SCALAR, gpu::UINT32, gpu::INDEX)),
|
||||||
_partBuffer(gpu::Element(gpu::VEC4, gpu::UINT32, gpu::PART)) {
|
_partBuffer(gpu::Element(gpu::VEC4, gpu::UINT32, gpu::PART)) {
|
||||||
auto compactColor = 0xFFFFFFFF;
|
const uint32_t compactColor = 0xFFFFFFFF;
|
||||||
_colorBuffer->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
_colorBuffer->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ void Mesh::setVertexFormatAndStream(const gpu::Stream::FormatPointer& vf, const
|
||||||
if (!_vertexFormat->hasAttribute(gpu::Stream::COLOR)) {
|
if (!_vertexFormat->hasAttribute(gpu::Stream::COLOR)) {
|
||||||
int channelNum = _vertexStream.getNumBuffers();
|
int channelNum = _vertexStream.getNumBuffers();
|
||||||
_vertexFormat->setAttribute(gpu::Stream::COLOR, channelNum, gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA), 0, gpu::Stream::PER_INSTANCE);
|
_vertexFormat->setAttribute(gpu::Stream::COLOR, channelNum, gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA), 0, gpu::Stream::PER_INSTANCE);
|
||||||
_vertexStream.addBuffer(_colorBuffer, channelNum, _vertexFormat->getChannels().at(channelNum)._stride);
|
_vertexStream.addBuffer(_colorBuffer, 0, _vertexFormat->getChannels().at(channelNum)._stride);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ void Mesh::evalVertexStream() {
|
||||||
// We require meshes to have a color attribute. If they don't, we default to white.
|
// We require meshes to have a color attribute. If they don't, we default to white.
|
||||||
if (!_vertexFormat->hasAttribute(gpu::Stream::COLOR)) {
|
if (!_vertexFormat->hasAttribute(gpu::Stream::COLOR)) {
|
||||||
_vertexFormat->setAttribute(gpu::Stream::COLOR, channelNum, gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA), 0, gpu::Stream::PER_INSTANCE);
|
_vertexFormat->setAttribute(gpu::Stream::COLOR, channelNum, gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA), 0, gpu::Stream::PER_INSTANCE);
|
||||||
_vertexStream.addBuffer(_colorBuffer, channelNum, _vertexFormat->getChannels().at(channelNum)._stride);
|
_vertexStream.addBuffer(_colorBuffer, 0, _vertexFormat->getChannels().at(channelNum)._stride);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1927,7 +1927,7 @@ void renderInstances(RenderArgs* args, gpu::Batch& batch, const glm::vec4& color
|
||||||
// Add color to named buffer
|
// Add color to named buffer
|
||||||
{
|
{
|
||||||
gpu::BufferPointer instanceColorBuffer = batch.getNamedBuffer(instanceName, INSTANCE_COLOR_BUFFER);
|
gpu::BufferPointer instanceColorBuffer = batch.getNamedBuffer(instanceName, INSTANCE_COLOR_BUFFER);
|
||||||
auto compactColor = GeometryCache::toCompactColor(color);
|
const uint32_t compactColor = GeometryCache::toCompactColor(color);
|
||||||
instanceColorBuffer->append(compactColor);
|
instanceColorBuffer->append(compactColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -355,7 +355,7 @@ void ModelMeshPartPayload::render(RenderArgs* args) {
|
||||||
procedural->prepare(batch, transform.getTranslation(), transform.getScale(), transform.getRotation(), _created,
|
procedural->prepare(batch, transform.getTranslation(), transform.getScale(), transform.getRotation(), _created,
|
||||||
ProceduralProgramKey(outColor.a < 1.0f, _shapeKey.isDeformed(), _shapeKey.isDualQuatSkinned()));
|
ProceduralProgramKey(outColor.a < 1.0f, _shapeKey.isDeformed(), _shapeKey.isDualQuatSkinned()));
|
||||||
|
|
||||||
auto compactColor = GeometryCache::toCompactColor(glm::vec4(outColor));
|
const uint32_t compactColor = GeometryCache::toCompactColor(glm::vec4(outColor));
|
||||||
_drawMesh->getColorBuffer()->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
_drawMesh->getColorBuffer()->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
||||||
} else {
|
} else {
|
||||||
// apply material properties
|
// apply material properties
|
||||||
|
@ -363,7 +363,7 @@ void ModelMeshPartPayload::render(RenderArgs* args) {
|
||||||
args->_details._materialSwitches++;
|
args->_details._materialSwitches++;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto compactColor = 0xFFFFFFFF;
|
const uint32_t compactColor = 0xFFFFFFFF;
|
||||||
_drawMesh->getColorBuffer()->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
_drawMesh->getColorBuffer()->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue