mirror of
https://github.com/overte-org/overte.git
synced 2025-04-15 03:47:56 +02:00
Toggleable unlit mode, physical hitbox
This commit is contained in:
parent
2865d257c8
commit
0313b4905e
5 changed files with 14 additions and 7 deletions
|
@ -12,8 +12,6 @@
|
||||||
#include <GeometryCache.h>
|
#include <GeometryCache.h>
|
||||||
#include <graphics/ShaderConstants.h>
|
#include <graphics/ShaderConstants.h>
|
||||||
|
|
||||||
#include "RenderPipelines.h"
|
|
||||||
|
|
||||||
using namespace render;
|
using namespace render;
|
||||||
using namespace render::entities;
|
using namespace render::entities;
|
||||||
|
|
||||||
|
@ -30,6 +28,7 @@ CanvasEntityRenderer::~CanvasEntityRenderer() {
|
||||||
|
|
||||||
void CanvasEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) {
|
void CanvasEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) {
|
||||||
_texture = entity->getTexture();
|
_texture = entity->getTexture();
|
||||||
|
_unlit = entity->getUnlit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CanvasEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene, Transaction& transaction, const TypedEntityPointer& entity) {
|
void CanvasEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene, Transaction& transaction, const TypedEntityPointer& entity) {
|
||||||
|
@ -65,7 +64,9 @@ void CanvasEntityRenderer::doRender(RenderArgs* args) {
|
||||||
_prevRenderTransform = transform;
|
_prevRenderTransform = transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
DependencyManager::get<GeometryCache>()->bindSimpleProgram(batch, true, true);
|
// FIXME: bindSimpleProgram doesn't support transparent and unlit,
|
||||||
|
// so we can only have one or the other
|
||||||
|
DependencyManager::get<GeometryCache>()->bindSimpleProgram(batch, true, !_unlit, _unlit, false, false, true, graphics::MaterialKey::CullFaceMode::CULL_NONE);
|
||||||
DependencyManager::get<GeometryCache>()->renderQuad(
|
DependencyManager::get<GeometryCache>()->renderQuad(
|
||||||
batch, glm::vec2(-0.5f), glm::vec2(0.5f), glm::vec2(0.0f, 1.0f), glm::vec2(1.0f, 0.0f),
|
batch, glm::vec2(-0.5f), glm::vec2(0.5f), glm::vec2(0.0f, 1.0f), glm::vec2(1.0f, 0.0f),
|
||||||
glm::vec4(1.0f), _geometryId
|
glm::vec4(1.0f), _geometryId
|
||||||
|
|
|
@ -36,7 +36,9 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
gpu::TexturePointer _texture;
|
gpu::TexturePointer _texture;
|
||||||
|
std::shared_ptr<graphics::ProceduralMaterial> _material { std::make_shared<graphics::ProceduralMaterial>() };
|
||||||
int _geometryId { 0 };
|
int _geometryId { 0 };
|
||||||
|
bool _unlit { false };
|
||||||
};
|
};
|
||||||
|
|
||||||
} }
|
} }
|
||||||
|
|
|
@ -19,9 +19,7 @@ public:
|
||||||
CanvasEntityItem(const EntityItemID& entityItemID);
|
CanvasEntityItem(const EntityItemID& entityItemID);
|
||||||
~CanvasEntityItem();
|
~CanvasEntityItem();
|
||||||
|
|
||||||
bool shouldBePhysical() const override { return false; }
|
virtual ShapeType getShapeType() const override { return SHAPE_TYPE_BOX; }
|
||||||
|
|
||||||
virtual bool supportsDetailedIntersection() const override { return false; }
|
|
||||||
|
|
||||||
ALLOW_INSTANTIATION // This class can be instantiated
|
ALLOW_INSTANTIATION // This class can be instantiated
|
||||||
ENTITY_PROPERTY_SUBCLASS_METHODS
|
ENTITY_PROPERTY_SUBCLASS_METHODS
|
||||||
|
|
|
@ -269,3 +269,4 @@ enum:SOUND_LOCAL_ONLY prop:localOnly type:bool default:false,
|
||||||
Canvas
|
Canvas
|
||||||
enum:CANVAS_WIDTH prop:width type:uint16_t default:128 basicProp,
|
enum:CANVAS_WIDTH prop:width type:uint16_t default:128 basicProp,
|
||||||
enum:CANVAS_HEIGHT prop:height type:uint16_t default:128 basicProp,
|
enum:CANVAS_HEIGHT prop:height type:uint16_t default:128 basicProp,
|
||||||
|
enum:UNLIT prop:unlit type:bool default:false common renderProp,
|
||||||
|
|
|
@ -1706,6 +1706,11 @@ const GROUPS = [
|
||||||
type: "number-draggable",
|
type: "number-draggable",
|
||||||
propertyID: "height",
|
propertyID: "height",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "Unlit",
|
||||||
|
type: "bool",
|
||||||
|
propertyID: "unlit",
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -2193,7 +2198,7 @@ const GROUPS_PER_TYPE = {
|
||||||
PolyVox: [ 'base', 'polyvox', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'collision', 'physics' ],
|
PolyVox: [ 'base', 'polyvox', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'collision', 'physics' ],
|
||||||
Grid: [ 'base', 'grid', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'physics' ],
|
Grid: [ 'base', 'grid', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'physics' ],
|
||||||
Sound: [ 'base', 'sound', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'physics' ],
|
Sound: [ 'base', 'sound', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'physics' ],
|
||||||
Canvas: [ 'base', 'canvas', 'spatial', 'grabAndEquip', 'scripts' ],
|
Canvas: [ 'base', 'canvas', 'spatial', 'grabAndEquip', 'scripts', 'physics' ],
|
||||||
Multiple: [ 'base', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'collision', 'physics' ],
|
Multiple: [ 'base', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'collision', 'physics' ],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue