mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-14 11:49:59 +01:00
Add soft shadow behind icons decoration to improve visibility in white
background.
This commit is contained in:
@@ -350,7 +350,10 @@ Symbol::Symbol(Type t, glm::vec3 pos) : Node(), type_(t)
|
||||
icons[EMPTY] = new Mesh("mesh/icon_empty.ply");
|
||||
}
|
||||
|
||||
static Mesh *shadow= new Mesh("mesh/border_handles_shadow.ply", "images/soft_shadow.dds");
|
||||
|
||||
symbol_ = icons[type_];
|
||||
shadow_ = shadow;
|
||||
translation_ = pos;
|
||||
color = glm::vec4( 1.f, 1.f, 1.f, 1.f);
|
||||
}
|
||||
@@ -365,6 +368,8 @@ void Symbol::draw(glm::mat4 modelview, glm::mat4 projection)
|
||||
if ( !initialized() ) {
|
||||
if(symbol_ && !symbol_->initialized())
|
||||
symbol_->init();
|
||||
if(shadow_ && !shadow_->initialized())
|
||||
shadow_->init();
|
||||
init();
|
||||
}
|
||||
|
||||
@@ -391,6 +396,7 @@ void Symbol::draw(glm::mat4 modelview, glm::mat4 projection)
|
||||
// generate matrix
|
||||
ctm = GlmToolkit::transform(tran, rot, sca);
|
||||
|
||||
shadow_->draw( ctm, projection );
|
||||
symbol_->draw( ctm, projection);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ public:
|
||||
glm::vec4 color;
|
||||
|
||||
protected:
|
||||
Primitive *handle_;
|
||||
Primitive *shadow_;
|
||||
Mesh *handle_;
|
||||
Mesh *shadow_;
|
||||
glm::vec2 corner_;
|
||||
Type type_;
|
||||
|
||||
@@ -74,6 +74,7 @@ public:
|
||||
|
||||
protected:
|
||||
Mesh *symbol_;
|
||||
Mesh *shadow_;
|
||||
Type type_;
|
||||
};
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ property uchar alpha
|
||||
element face 2
|
||||
property list uchar uint vertex_indices
|
||||
end_header
|
||||
0.1500000 -0.1500000 0.000000 1.000000 0.000000 255 255 255 45
|
||||
-0.1500000 0.1500000 0.000000 0.000000 1.000000 255 255 255 45
|
||||
-0.1500000 -0.1500000 0.000000 0.000000 0.000000 255 255 255 45
|
||||
0.1500000 0.1500000 0.000000 1.000000 1.000000 255 255 255 45
|
||||
0.1500000 -0.1500000 0.000000 1.000000 0.000000 255 255 255 65
|
||||
-0.1500000 0.1500000 0.000000 0.000000 1.000000 255 255 255 65
|
||||
-0.1500000 -0.1500000 0.000000 0.000000 0.000000 255 255 255 65
|
||||
0.1500000 0.1500000 0.000000 1.000000 1.000000 255 255 255 65
|
||||
3 0 1 2
|
||||
3 0 3 1
|
||||
|
||||
Reference in New Issue
Block a user