Text.cpp
Go to the documentation of this file.
5 #warning "TODO - Text currently uses only MSDF variant of the text. Details about the problem and possible solutions are in comment below."
7 The problem is that texture_id is set in first_pass but variants (and therefore texture_id) would be selected in second_pass.
8 One solution would be to have concept of unknown texture_ids in render queues, so that the sorting will be a bit problematic, but it would work.
9 Other solution is to have some kind of permanency of pointers in render queues - so that we would not need to add renderables
10 to render queues each frame (in first_pass) but only when their properties change (so that it can be done in second_pass which is not called each frame).
11 One problem with that would be the fact that we recompute draw order each frame in initialization part of first_pass - that is changed each frame,
12 so that needs to be set in first_pass - but maybe render queue could query that value during sorting phase of render."
13 Either way - lets test and profile and improve the element graph rendering before implementing this.
16 -> Or make renderer ask each instance for texture_id right before sorting, in render pass, after second pass.
137 return this->mesh.ComputeGeometry( this->attr_text.Get(), this->attr_fontSize.Get(), location );
143 if( this->attr_text.clear_dirty() || this->attr_font.clear_dirty() || this->attr_fontSize.clear_dirty()
151 this->mesh.GenerateMesh( this->attr_text.Get(), this->attr_fontSize.Get(), this->location.Get() );
160 // TODO - maybe implement selection of font variant - regenerate mesh if selected variant for given model_transform changed
166 this->mesh.Render( camera, this->modelTransform.Get(), this->attr_color.Get(), this->attr_preblend.Get(), this->attr_translucent.Get(), depth_override, this->scissor.Get() );