mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 20:32:21 +02:00
work toward getting textures on polyvox entities
This commit is contained in:
parent
419caccd8e
commit
56c0f9c814
2 changed files with 11 additions and 7 deletions
|
@ -706,8 +706,8 @@ void RenderablePolyVoxEntityItem::render(RenderArgs* args) {
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
slotBindings.insert(gpu::Shader::Binding(std::string("materialBuffer"), MATERIAL_GPU_SLOT));
|
slotBindings.insert(gpu::Shader::Binding(std::string("materialBuffer"), MATERIAL_GPU_SLOT));
|
||||||
// slotBindings.insert(gpu::Shader::Binding(std::string("diffuseMap"), 0));
|
slotBindings.insert(gpu::Shader::Binding(std::string("xMap"), 0));
|
||||||
// slotBindings.insert(gpu::Shader::Binding(std::string("normalMap"), 1));
|
slotBindings.insert(gpu::Shader::Binding(std::string("yMap"), 1));
|
||||||
// slotBindings.insert(gpu::Shader::Binding(std::string("specularMap"), 2));
|
// slotBindings.insert(gpu::Shader::Binding(std::string("specularMap"), 2));
|
||||||
// slotBindings.insert(gpu::Shader::Binding(std::string("emissiveMap"), 3));
|
// slotBindings.insert(gpu::Shader::Binding(std::string("emissiveMap"), 3));
|
||||||
// slotBindings.insert(gpu::Shader::Binding(std::string("lightBuffer"), 4));
|
// slotBindings.insert(gpu::Shader::Binding(std::string("lightBuffer"), 4));
|
||||||
|
@ -739,7 +739,6 @@ void RenderablePolyVoxEntityItem::render(RenderArgs* args) {
|
||||||
sizeof(float) * 3,
|
sizeof(float) * 3,
|
||||||
mesh->getVertexBuffer()._stride);
|
mesh->getVertexBuffer()._stride);
|
||||||
batch.setIndexBuffer(gpu::UINT32, mesh->getIndexBuffer()._buffer, 0);
|
batch.setIndexBuffer(gpu::UINT32, mesh->getIndexBuffer()._buffer, 0);
|
||||||
batch.drawIndexed(gpu::TRIANGLES, mesh->getNumIndices(), 0);
|
|
||||||
|
|
||||||
if (!_xTextureURL.isEmpty() && !_xTexture) {
|
if (!_xTextureURL.isEmpty() && !_xTexture) {
|
||||||
_xTexture = DependencyManager::get<TextureCache>()->getTexture(_xTextureURL);
|
_xTexture = DependencyManager::get<TextureCache>()->getTexture(_xTextureURL);
|
||||||
|
@ -756,6 +755,11 @@ void RenderablePolyVoxEntityItem::render(RenderArgs* args) {
|
||||||
if (_xTexture) {
|
if (_xTexture) {
|
||||||
batch.setResourceTexture(0, _xTexture->getGPUTexture());
|
batch.setResourceTexture(0, _xTexture->getGPUTexture());
|
||||||
}
|
}
|
||||||
|
if (_yTexture) {
|
||||||
|
batch.setResourceTexture(1, _yTexture->getGPUTexture());
|
||||||
|
}
|
||||||
|
|
||||||
|
batch.drawIndexed(gpu::TRIANGLES, mesh->getNumIndices(), 0);
|
||||||
|
|
||||||
RenderableDebugableEntityItem::render(this, args);
|
RenderableDebugableEntityItem::render(this, args);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,8 +49,8 @@ void main(void) {
|
||||||
|
|
||||||
packDeferredFragment(
|
packDeferredFragment(
|
||||||
normalize(interpolatedNormal.xyz),
|
normalize(interpolatedNormal.xyz),
|
||||||
evalOpaqueFinalAlpha(getMaterialOpacity(mat), diffuse.a),
|
0.0,
|
||||||
getMaterialDiffuse(mat) * diffuse.rgb * color,
|
/*getMaterialDiffuse(mat)*/ /*diffuse.rgb * color*/ vec3(1.0, 1.0, 1.0),
|
||||||
getMaterialSpecular(mat),
|
/*getMaterialSpecular(mat)*/ vec3(0.02, 0.02, 0.02),
|
||||||
getMaterialShininess(mat));
|
/*getMaterialShininess(mat)*/ 10.0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue