mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 21:23:18 +02:00
Added outline intensity
This commit is contained in:
parent
57dfe10baf
commit
0f2c41b009
5 changed files with 19 additions and 3 deletions
|
@ -66,5 +66,6 @@ void main(void) {
|
|||
if (outlineIntensity < 1e-3) {
|
||||
discard;
|
||||
}
|
||||
outlineIntensity = min(1.0, outlineIntensity * params._intensity);
|
||||
outFragColor = vec4(params._color.rgb, outlineIntensity);
|
||||
}
|
||||
|
|
|
@ -130,7 +130,8 @@ DrawOutline::DrawOutline() {
|
|||
|
||||
void DrawOutline::configure(const Config& config) {
|
||||
_color = config.color;
|
||||
_size = config.width;
|
||||
_size = config.width / 1024.f;
|
||||
_intensity = config.intensity * 10.f;
|
||||
}
|
||||
|
||||
void DrawOutline::run(const render::RenderContextPointer& renderContext, const Inputs& inputs) {
|
||||
|
@ -147,7 +148,8 @@ void DrawOutline::run(const render::RenderContextPointer& renderContext, const I
|
|||
{
|
||||
auto& configuration = _configuration.edit();
|
||||
configuration._color = _color;
|
||||
configuration._size = _size / 1024.f;
|
||||
configuration._size = _size;
|
||||
configuration._intensity = _intensity;
|
||||
}
|
||||
|
||||
gpu::doInBatch(args->_context, [&](gpu::Batch& batch) {
|
||||
|
|
|
@ -76,6 +76,7 @@ private:
|
|||
class DrawOutlineConfig : public render::Job::Config {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(float width MEMBER width NOTIFY dirty)
|
||||
Q_PROPERTY(float intensity MEMBER intensity NOTIFY dirty)
|
||||
Q_PROPERTY(float colorR READ getColorR WRITE setColorR NOTIFY dirty)
|
||||
Q_PROPERTY(float colorG READ getColorG WRITE setColorG NOTIFY dirty)
|
||||
Q_PROPERTY(float colorB READ getColorB WRITE setColorB NOTIFY dirty)
|
||||
|
@ -90,8 +91,9 @@ public:
|
|||
void setColorB(float value) { color.b = value; emit dirty(); }
|
||||
float getColorB() const { return color.b; }
|
||||
|
||||
float width{ 5.f };
|
||||
glm::vec3 color{ 1.f, 0.7f, 0.2f };
|
||||
float width{ 5.f };
|
||||
float intensity{ 1.f };
|
||||
|
||||
signals:
|
||||
void dirty();
|
||||
|
@ -125,6 +127,7 @@ private:
|
|||
OutlineConfigurationBuffer _configuration;
|
||||
glm::vec3 _color;
|
||||
float _size;
|
||||
float _intensity;
|
||||
};
|
||||
|
||||
class DebugOutlineConfig : public render::Job::Config {
|
||||
|
|
|
@ -9,6 +9,7 @@ struct OutlineParameters
|
|||
{
|
||||
VEC3 _color;
|
||||
float _size;
|
||||
float _intensity;
|
||||
};
|
||||
|
||||
// <@if 1@>
|
||||
|
|
|
@ -44,6 +44,15 @@ Item {
|
|||
min: 0.0
|
||||
width: 230
|
||||
}
|
||||
ConfigSlider {
|
||||
label: "Intensity"
|
||||
integral: false
|
||||
config: root.drawConfig
|
||||
property: "intensity"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
width: 230
|
||||
}
|
||||
ConfigSlider {
|
||||
label: "Color R"
|
||||
integral: false
|
||||
|
|
Loading…
Reference in a new issue