mirror of
https://github.com/overte-org/overte.git
synced 2025-04-06 22:32:57 +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!
|
||||
auto compactColor = 0xFFFFFFFF;
|
||||
const uint32_t compactColor = 0xFFFFFFFF;
|
||||
_colorBuffer->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
||||
DependencyManager::get<GeometryCache>()->renderShape(batch, GeometryCache::Shape::Sphere, _colorBuffer);
|
||||
} else {
|
||||
|
@ -347,7 +347,7 @@ void MaterialEntityRenderer::doRender(RenderArgs* args) {
|
|||
proceduralDrawMaterial->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);
|
||||
if (render::ShapeKey(args->_globalShapeKey).isWireframe() || _primitiveMode == PrimitiveMode::LINES) {
|
||||
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));
|
||||
});
|
||||
|
||||
auto compactColor = GeometryCache::toCompactColor(glm::vec4(outColor));
|
||||
const uint32_t compactColor = GeometryCache::toCompactColor(glm::vec4(outColor));
|
||||
_colorBuffer->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
||||
if (wireframe) {
|
||||
geometryCache->renderWireShape(batch, geometryShape, _colorBuffer);
|
||||
|
@ -151,7 +151,7 @@ void ShapeEntityRenderer::doRender(RenderArgs* args) {
|
|||
geometryCache->renderSolidShapeInstance(args, batch, geometryShape, outColor, pipeline);
|
||||
}
|
||||
} 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);
|
||||
if (wireframe) {
|
||||
geometryCache->renderWireShape(batch, geometryShape, _colorBuffer);
|
||||
|
@ -164,7 +164,7 @@ void ShapeEntityRenderer::doRender(RenderArgs* args) {
|
|||
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);
|
||||
geometryCache->renderShape(batch, geometryShape, _colorBuffer);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ Mesh::Mesh() :
|
|||
_vertexBuffer(gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::XYZ)),
|
||||
_indexBuffer(gpu::Element(gpu::SCALAR, gpu::UINT32, gpu::INDEX)),
|
||||
_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);
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ void Mesh::setVertexFormatAndStream(const gpu::Stream::FormatPointer& vf, const
|
|||
if (!_vertexFormat->hasAttribute(gpu::Stream::COLOR)) {
|
||||
int channelNum = _vertexStream.getNumBuffers();
|
||||
_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.
|
||||
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);
|
||||
_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
|
||||
{
|
||||
gpu::BufferPointer instanceColorBuffer = batch.getNamedBuffer(instanceName, INSTANCE_COLOR_BUFFER);
|
||||
auto compactColor = GeometryCache::toCompactColor(color);
|
||||
const uint32_t compactColor = GeometryCache::toCompactColor(color);
|
||||
instanceColorBuffer->append(compactColor);
|
||||
}
|
||||
|
||||
|
|
|
@ -355,7 +355,7 @@ void ModelMeshPartPayload::render(RenderArgs* args) {
|
|||
procedural->prepare(batch, transform.getTranslation(), transform.getScale(), transform.getRotation(), _created,
|
||||
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);
|
||||
} else {
|
||||
// apply material properties
|
||||
|
@ -363,7 +363,7 @@ void ModelMeshPartPayload::render(RenderArgs* args) {
|
|||
args->_details._materialSwitches++;
|
||||
}
|
||||
|
||||
auto compactColor = 0xFFFFFFFF;
|
||||
const uint32_t compactColor = 0xFFFFFFFF;
|
||||
_drawMesh->getColorBuffer()->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue