ExBemined Posted October 7, 2020 Share Posted October 7, 2020 Does Unigine provide a way of creating dynamic decal texts? So basically an ObjectText that can be projected onto a surface instead of rendering the text in 3D. Use case for example is a number on top of a police car which is different for each car and can be edited in runtime by the user. Since the roof isn't flat we need to project the text, an ObjectText would look incorrect from certain angles. Link to comment
silent Posted October 7, 2020 Share Posted October 7, 2020 Bemined There is no option to project ObjectText as decal. You can draw number texture and project it as normal decal right now. We have a minor priority task for such ObjectText extension, but right now there will be no research done, so it's not completely clear how big this task is and if it even possible to implement such functionality. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
ExBemined Posted October 7, 2020 Author Share Posted October 7, 2020 Thanks, So what would be the best approach for rendering text to a texture? Rendering a Widget to a RenderTarget? Since some use-cases involve variable length texts, for this we need to know the width of the rendered text in order to correctly scale and align the decal. Since this length depends on the font (for non-monospace fonts) we need to query this from the engine somehow. Looking at the API I could only find WidgetExternBase::get_text_size, but that would require us to inherit and create our own widget. Or is it possible to get the length some other way as well? Link to comment
silent Posted October 7, 2020 Share Posted October 7, 2020 My suggestion was mostly about artists, that can prepare required textures for you :) If they skilled enough some Photoshop scripting magic can be used to semi-automate the process. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
ExBemined Posted October 7, 2020 Author Share Posted October 7, 2020 Unfortunately the decals are not limited to just a few numbers, the user can freely type whatever he wants to show as name or number on the vehicle. So it's not possible to prepare all possible combinations in a texture. Link to comment
silent Posted October 7, 2020 Share Posted October 7, 2020 Maybe this approach will help: Here we use 3rd party library to generate texture and export it. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts