Jump to content

Josh

Staff
  • Posts

    25,020
  • Joined

  • Last visited

About Josh

Profile Information

  • Location
    USA

Recent Profile Visitors

1,509,104 profile views

Josh's Achievements

Grand Master

Grand Master (14/14)

  • Well Followed
  • Dedicated
  • Conversation Starter
  • Reacting Well
  • Problem Solver

Recent Badges

15.8k

Reputation

903

Community Answers

  1. 0.9.9 World::SetShadowQuality now accepts a float value. 1.0 is default. 0.5 is 50% resolution. 2.0 is 200% resolution. You might want to check what your current setting is in the options dialog. Fixed bug where texture clamping was not being performed on texture buffer attachments. Full update.
  2. A new dialog will be included in the next build that lets you rescale loaded terrain heightmaps. There are different ways raw files can be encoded, so if something is not acting the way you expect please upload a raw file and describe the format.
  3. 0.9.9 Removed TEXTURE_CLAMP_U, TEXTURE_CLAMP_V, TEXTURE_CLAMP_UV, and TEXTURE_CLAMPUVW since we now have a separate Texture::SetClampMode command. Fixed terrain heightmaps not working with latest revision of texture system. Fixed loading and saving of RAW, R32, R16, R32F, and R16F pixmaps;. Removed TIF, PCX, GIF, image formats from file dialogs in the editor because these are not common formats and just get in the way. Terrain heightmaps can now be saved in either DDS or RAW formats. Added load terrain heightmap dialog, for specifying the minimum and maximum elevation of a non-float heightmap. Terrain::LoadHeightmap now takes an optional Vec2 range argument for rescaling the loaded height data. Bug fixes. Only the editor is updated at this time.
  4. More generally, I think the problem is that the existing instances of models placed in the scene are not being reloaded when the source model file is modified...
  5. Closing this due to lack of information. Feel free to post a new thread if you have more info, thanks.
  6. I need the material and texture files in order to test this. I can't test it with just the map file.
  7. Pretty darn good now #include "Leadwerks.h" using namespace Leadwerks; int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Leawerks 5", 0, 0, 800, 100, displays[0], WINDOW_DEFAULT | WINDOW_CLIENTCOORDS); auto menuWold = CreateWorld(); auto framebuffer = CreateFramebuffer(window); auto uiCamera = CreateCamera(menuWold, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); uiCamera->SetClearMode(CLEAR_DEPTH); auto default_font = LoadFont("Fonts\\arial.ttf"); auto ui = CreateInterface(uiCamera, default_font, framebuffer->GetSize()); auto panel = CreatePanel(10, 10, ui->background->size.x - 20, ui->background->size.y - 20, ui->background); panel->SetColor(0, 0, 1); String s = "Enemy in full armored biosuit which can be penetrate only with nails.\nBalloon at the back can be destroyed and it will cause an explosion.\nHis laser rifle shoots at long range and charged shot can hit few units in the shot line."; auto customWidget = CreateLabel("", 0, 0, panel->size.x, panel->size.y, panel, LABEL_CENTER | LABEL_MIDDLE); customWidget->SetText(s); customWidget->SetFontScale(2.0f); //auto tile = CreateTile(uiCamera, default_font, s, 12.0f * 2.0f, TEXT_MIDDLE); //tile->SetOrder(100000); //tile->SetPosition(10, 50); while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { menuWold->Update(); menuWold->Render(framebuffer); } return 0; }
  8. Testing a multi-line label... #include "Leadwerks.h" using namespace Leadwerks; int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Leawerks 5", 0, 0, 800, 250, displays[0], WINDOW_DEFAULT); auto menuWold = CreateWorld(); auto framebuffer = CreateFramebuffer(window); auto uiCamera = CreateCamera(menuWold, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); uiCamera->SetClearMode(CLEAR_DEPTH); auto default_font = LoadFont("Fonts\\arial.ttf"); auto ui = CreateInterface(uiCamera, default_font, framebuffer->GetSize()); auto panel = CreatePanel(10, 10, ui->background->size.x - 20, ui->background->size.y - 20, ui->background); panel->SetColor(0, 0, 1); auto customWidget = CreateLabel("", 0, 0, panel->size.x, panel->size.y, panel, LABEL_CENTER | LABEL_MIDDLE); customWidget->SetText("Enemy in full armored biosuit which can be penetrate only with nails.\nBalloon at the back can be destroyed and it will cause an explosion.\nHis laser rifle shoots at long range and charged shot can hit few units in the shot line."); customWidget->SetFontScale(2.0f); while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { menuWold->Update(); menuWold->Render(framebuffer); } return 0; }
  9. Since FreeType does not provide the font height, I just started using the height of the letter E for the font height, and it works fine. Problems may arise in the future for fonts that do not have this character.
  10. Just testing with tiles now... #include "Leadwerks.h" using namespace UltraEngine; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> menuWold; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; int main(int argc, const char* argv[]) { auto displays = GetDisplays(); window = CreateWindow("Ultra Engine", 0, 0, 800, 250, displays[0], WINDOW_DEFAULT); menuWold = CreateWorld(); framebuffer = CreateFramebuffer(window); uiCamera = CreateCamera(menuWold, PROJECTION_ORTHOGRAPHIC); auto font = LoadFont("Fonts\\arial.ttf"); auto tile1 = CreateTile(uiCamera, 100, 12); tile1->SetColor(0, 0, 1); auto tile2 = CreateTile(uiCamera, font, "ESCpppp123", 12, TEXT_MIDDLE); tile2->SetPosition(0, 6); while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { menuWold->Update(); menuWold->Render(framebuffer); } return 0; }
  11. Strangely, replacing the custom widget with a label produces slightly different results...
  12. Okay, I am testing with this code... #include "Leadwerks.h" using namespace UltraEngine; class CustomWidget : public Panel { protected: virtual bool Initialize(const int x, const int y, const int width, const int height, shared_ptr<Widget> parent) { blocks.resize(2); return Widget::Initialize(text, x, y, width, height, parent, style); } void Draw(const int x, const int y, const int width, const int height) { blocks[0].color = Vec4(0, 0, 1, 1); blocks[0].wireframe = false; blocks[0].position = 0; blocks[0].size = this->size; blocks[0].hidden = false; blocks[1].hidden = false; blocks[1].position = 0; blocks[1].size = this->size; blocks[1].SetText(text); blocks[1].textalignment = TEXT_LEFT | TEXT_MIDDLE; } public: static shared_ptr<CustomWidget> create(const int x, const int y, const int width, const int height, shared_ptr<Widget> parent) { struct Struct : public CustomWidget { }; auto instance = std::make_shared<Struct>(); instance->Initialize(x, y, width, height, parent); return instance; } }; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> menuWold; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; shared_ptr<CustomWidget> customWidget; void initGui() { uiCamera = CreateCamera(menuWold, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); uiCamera->SetRenderLayers(2); uiCamera->SetClearMode(CLEAR_DEPTH); auto default_font = LoadFont("Fonts\\arial.ttf"); ui = CreateInterface(uiCamera, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); float scale = 1.0f; customWidget = CustomWidget::create(10, 10, 800, 14 * scale, ui->root); customWidget->SetText("ESCpppp123"); customWidget->SetFontScale(scale); } int main(int argc, const char* argv[]) { auto displays = GetDisplays(); window = CreateWindow("Ultra Engine", 0, 0, 800, 250, displays[0], WINDOW_DEFAULT); menuWold = CreateWorld(); framebuffer = CreateFramebuffer(window); initGui(); while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { menuWold->Update(); menuWold->Render(framebuffer); } return 0; }
  13. Okay, first step should probably be to determine exactly what is making up that load time, and whether the number of entities is actually the bottleneck, before we attempt to solve it with a complicated multithreaded system. What are the load times, in debug and release builds? It's possible that JSON might not scale well, but I can't tell until I test. Textures load pretty much instantaneously, but may hit a bottleneck when they are being uploaded to the GPU. I doubt this is a problem, but have not measured at at scale. Mesh data should load fast, but there is a processing step when vertex data is converted to the more optimized layout that actually gets sent to the GPU. I don't think this is an issue, but maybe STL is running slow in debug builds.
×
×
  • Create New...