Jump to content

sdxsdx

Developers
  • Posts

    33
  • Joined

  • Last visited

Posts posted by sdxsdx

  1. 1 hour ago, Josh said:

    I'm not exactly sure what you are trying to do. Are the cubes all on a flat plane? If so, it would make sense to just remove them and add a transparent blue plane where the water surface is.

    Thank you for your reply.

    How could I set the transparent blue plane with penetration?

    I want the object can sink into the blue cube.

  2. 8 minutes ago, Josh said:

    You need to create the 3D camera before the UI camera, or call camera->SetOrder() to adjust the order they render in.

     

    CreateTextField does not work but CreateLabel works fine.

    May be I am setting something wrong?

     

     

  3. std::shared_ptr<UltraEngine::Interface> ui = UltraEngine::CreateInterface(window);
        auto sz = ui->root->ClientSize();
        ui->SetRenderLayers(128);
        auto text = CreateTextField(0, 50, 100, 30, ui->root,UltraEngine::TEXTFIELD_DEFAULT);
        text->SetText("Hello World!");
    
        auto uicam = CreateCamera(world, PROJECTION_ORTHOGRAPHIC);
        uicam->SetClearMode(CLEAR_DEPTH);
        uicam->SetRenderLayers(128);
        uicam->SetPosition(framebuffer->size.x / 2, framebuffer->size.y / 2);
    
    
        //Main loop
        while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
        {
            text->SetText("Hello World!");
      
            while (PeekEvent()) {
                auto event = WaitEvent();
                ui->ProcessEvent(event);
            }
            
            world->Update();
            world->Render(framebuffer);
            
        }

    Am I missing anything?

    I have two camera, one camera runs the 3d world, one runs the interface;

    But the 3d world camera seems to override the interface camera.

  4. 3 hours ago, Josh said:

    In the default main.lua script there is some code that shows stats and FPS.

    	--Render statistics
    	context:SetBlendMode(Blend.Alpha)
    	if DEBUG then
    		context:SetColor(1,0,0,1)
    		context:DrawText("Debug Mode",2,2)
    		context:SetColor(1,1,1,1)
    		context:DrawStats(2,22)
    		context:SetBlendMode(Blend.Solid)
    	else
    		--Toggle statistics on and off
    		if (window:KeyHit(Key.F11)) then showstats = not showstats end
    		if showstats then
    			context:SetColor(1,1,1,1)
    			context:DrawText("FPS: "..Math:Round(Time:UPS()),2,2)
    		end
    	end

    I usually use a third-party tool like FRAPS because it ensures consistency across all programs.

    Thanks you, how could I increase the shadow rendering distance? I have tired  world->SetLightQuality(2) or light->SetRange(10000) or     light->SetRange(-10000,10000), it doesn't work.

       

  5.  

    auto sprite = CreateSprite(world, font, "FPS", 18);
        sprite->SetRenderLayers(128);
        sprite->SetPosition(2, framebuffer->size.y - font->GetHeight(18) - 2, 0);
        sprite->SetRenderLayers(2);
        world->RecordStats();
    
        auto uicam = CreateCamera(world, PROJECTION_ORTHOGRAPHIC);
        uicam->SetClearMode(CLEAR_DEPTH);
        uicam->SetRenderLayers(2);
        uicam->SetPosition(framebuffer->size.x / 2, framebuffer->size.y / 2);
    
        //Main loop
        while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
        {
            sprite->SetText("FPS:" + (String)world->renderstats.framerate);
            while (PeekEvent()) {
                ui->ProcessEvent(WaitEvent());
            }
            world->Update();
            world->Render(framebuffer);
        }

     

     

    I modified some lines and this works for fps showing.

     

    The second question is still not answered.

     

  6.  

    I have found:
    
    auto font = LoadFont("Fonts/arial.ttf");
        auto sprite = CreateSprite(world, font, "", 18);
        sprite->SetRenderLayers(128);
        sprite->SetPosition(2, framebuffer->size.y - font->GetHeight(18) - 2, 0);
    
        //Main loop
        while (window->Closed() == false)
        {
            //Display the feamerate
            sprite->SetText("FPS: " + String(world->renderstats.framerate));
    
            world->Update();
            world->Render(framebuffer);
        }

     

    but I still can't see the fps.

     

  7. When I start a new project, I got this error message;

    Severity    Code    Description    Project    File    Line    Suppression State
    Error    C1007    unrecognized flag '-Zc:nrvo' in 'p2'    test    C:\Users\xxx\Documents\Ultra Engine\Projects\test\LINK    1    
     

    I have tried 1.0,1.01.1.02,1.03 all versions. and the results are same.

    visual studio 2022,2019 are same too.

    111.png

×
×
  • Create New...