Jump to content

Lupin

Developers
  • Posts

    24
  • Joined

  • Last visited

Posts posted by Lupin

  1.  

    Maybe I missed something, so I would like to ask if Ultra, in addition to Vulkan, has a planned OpenGL 4.6 backend ?
    I wouldn't have bothered you with this question if I hadn't noticed the mention in the thread:

    Quote

    ... it looks like OpenGL 4.6 gives AMD a major performance boost and runs about the same as Vulkan on Nvidia cards in these tests.

    Personally I think that such an "legacy" backend would be a reasonable addition. This would provide the potential ability to run applications on a wider hardware base, so engine would therefore be an solution not only for games requiring high performance, but also for casual indie games, including retro-style.

    Anyway, if this is indeed the plan, would it be possible in future to select/force the engine to use a specific backend on initialization (something like: use OpenGL, Vulkan or Auto/default)?

     

     

  2.  

    Where's the best place to report minor mistakes in the documentation - here, on the forum (in bug thread?) or on GitHub?

    So far, I noticed that according to the documentation, functions that create lights return nothing (which can be confusing).

    • void CreateBoxLight(...)
    • void CreateSpotLight(...)
    • void CreateDirectionalLight(...)

    While the one below is described correctly:

    • shared_ptr<PointLight> CreatePointLight(...)

     

  3.  

    Tahnks for replies.
    After reading, I realized that instead of describe the problem, I wrote an observation, that I (mistakenly) thought explained the source of the problem.

    A potential bug, as correctly described Dreikblack, is that:
    Once a window has been created, it cannot be physically closed other than by completely terminating the program.

    I think this is a minor, low priority thing, but could be looked into at some point. Or maybe there is a workaround?

    #include "UltraEngine.h"
    #include <iostream>
    #include <chrono>
    #include <thread>
    
    using namespace UltraEngine;
    
    void RunTestProc() {
        auto window = CreateWindow("Ultra Engine", 0, 0, 800, 600, GetDisplays()[0], WINDOW_CENTER | WINDOW_TITLEBAR);
        auto world = CreateWorld();
        auto framebuffer = CreateFramebuffer(window);
        auto camera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC);
        while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); }
        window->FlushKeys(); window->FlushMouse();
        FlushEvents();
        std::cout << "before exit func window.use_count = " << window.use_count() << std::endl;
    }
    
    int main(int argc, const char* argv[])
    {
        RunTestProc();
       
        // theoretically there are no user object references left at this point, so the window should be closed ?
        // but it is still open, although non - functional.
    
        std::this_thread::sleep_for(std::chrono::milliseconds(1000)); // just to be sure...
        Print("\nCan you still see the window?\n");
        system("pause");
        return 0;
    }

    It seems to me that some resources are not being deleted, even though all user-created references have gone out of scope.
    Perhaps they are what keep the window alive?

    Quote

    Loading shader family "Shaders/PBR.fam"
    Loading shader family "Shaders/Sky.fam"
    Loading shader family "Shaders/Unlit.fam"
    Loading posteffect "Shaders/Refraction.fx"
    Loading shader module "Shaders/BlurX.frag.spv"
    Loading shader module "Shaders/BlurY.frag.spv"
    before exit func window.use_count = 4
    Deleting shader family "Shaders/Sky.fam"

    Can you still see the window?

    Press any key to continue...
    Deleting shader family "Shaders/Unlit.fam"

     

     

    • Thanks 1
  4.  

    The reference counter in smart_ptr<Window> increments with each input event, e.g. mouse movement, key presses, etc.
    Seems like, it stops after reaching the number of 1005 references (the program continues to work normally).
    This doesn't seem to be a problem, but it may be a sign that there is an small bug somewhere?

    You can check this by adding inside the render loop:

    window->SetText(WString(window.use_count()));

    Latest dev build, checked on Debug and Release.
    I didn't notice anything similar with other objects.

     

    • Upvote 1
  5. witawat,

    If You are asking about programming, do it rather at "Programming" section, please.

    Now to look "LE2 Starter Kit for Delphi and FreePascal", but not document about load my map or any for beginer

    i think about document is small ..

    Starter Kit contains ready to compile and run examples (commented Pascal source code) generally only for beginners (beginners on LE, not in programming...). Most examples are based on official tutorials, so, for full understanding, you should start from these documents and videos: http://www.leadwerks...e2/_/tutorials/

    Official tutorials are written with C++, so for fast startup with Pascal, use corresponding code from "LE2 Starter Kit for Delphi and FreePascal". For example: if you analyze "Making a spectator" tutorial, use "MakingASpectator.pas" as Pascal syntax reference for this tutorial.

     

    And now, step-by-step instruction how to make simple program in Lazarus for loading scene file created in Editor.

     

    1. Create new folder and copy header files here (LEUtils.pas, LECore.pas, LEObjects.pas).

    2. Open Lazarus IDE.

    3. Make new project (File->New->Console application), then [Cancel] on creator window.

    4. Replace code in source editor window (copy-paste from here):

     

    program project1;
    {$MODE DELPHI}
    uses LEUtils, LECore, LEObjects;
    var // Entities
    lua : Pointer;
    fw : TFramework;
    camera : TCamera;
    // Camera moving and rotation variables
    camrotation : TVec3;
    mx, my : Single;
    move, strafe : Single;
    begin
     // Initialization
     RegisterAbstractPath ('');
     Graphics(800,600);
     HideMouse;
     MoveMouse (GraphicsWidth div 2, GraphicsHeight div 2);
     // Setup framework
     fw := CreateFramework;
     lua := GetLuaState;
     lua_pushobject(lua,fw);
     lua_setglobal(lua,'fw');
     lua_pop(lua,1);
     fw.SetHDR(1);
     fw.SetBloom(1);
     // Create player camera
     camera := fw.Main.Camera;
     camera.SetPosition(-4,2,0);
     // Load a scene created in editor
     LoadScene('abstract::tunnels.sbx');
     // Startup camera transformation values
     with camrotation do begin X:=0; Y:=0; Z:=0; end;
     mx:=0; my:=0; move:=0; strafe:=0;
     // Main loop
     while (not AppTerminate) and (KeyHit(KEY_ESCAPE)=0) do begin
      // Camera mouse look
      mx:=Curve(MouseX-GraphicsWidth/2,mx,6);
      my:=Curve(MouseY-GraphicsHeight/2,my,6);
      MoveMouse (GraphicsWidth div 2, GraphicsHeight div 2);
      camrotation.x := camrotation.x+my/10;
      camrotation.y := camrotation.y-mx/10;
      camera.SetRotation(camrotation);
      // Camera movement WASD
      move := Curve(KeyDown(KEY_W)-KeyDown(KEY_S),move,20);
      strafe := Curve(KeyDown(KEY_D)-KeyDown(KEY_A),strafe,20);
      camera.Move(Vec3(strafe/10,0,move/10));
      // Render by framework
      fw.Update;
      fw.Render;
      Flip;
     end;
    end.
    

     

     

    By the way, no offense, but if you don't understand what these commands do, try start from analyzing tutorials and documentation.

     

    5. Save project in folder created on step 1.

    6. Build project (Run->Build or Ctrl+F9). In messages window you should see "Project "project1" successfully built"

    7. Copy "project1.exe" file from project folder to your Leadwerks Engine root folder (where Editor.exe and engine.dll exists).

    8. Run project1.exe from engine root folder.

     

    Now you should see tunnels scene (and you can fly around: mouse + WASD). You could try loading your own scene (instead "tunnels.sbx"). In next step you can extending this project by programming some gameplay.

     

    post-42-0-14319200-1334253525_thumb.png

     

    I hope this helps.

    • Upvote 1
  6. You can also try with my "Starter Kit" package for Delphi and Lazarus / FreePascal. It's ready to use - contains the actual headers and a bit over 20 ready to run simple examples. Each example is a separate *.pas unit. All units are compiled into a single application with project file "LETutorials.dpr". Content is just updated and now is compatible with the latest version LE 2.5.

     

    See here: http://www.leadwerks...and-freepascal/

     

    Have fun.

     

    post-42-0-76444300-1334146107_thumb.jpg

  7. I hope that something like that would be really possible? Of course 3DS Max is a slight exaggeration ;) , but adding of smoothing (by smoothing groups, or automatic by angle between face normals) and some additional brushes like a ball, a "real" torus (made by revolving a circle), etc. will be very appreciated.

    Incorporating 3DWS with some extensions into LE3D editor, would make this tool unique in class. How many engines allow you to edit the geometry in the editor? Source, Unreal,... I do not know more.

     

    Despite the simplicity, the 3DWS allows you to easy create various non-organic lowpoly models - not only the architecture, as some claim.

    Here's an example - my chair created entirely with brushes in 3DWS.

    chair_3dws.zip

    From a distance does not look bad (as placeholder in game prototype - better than a cube :P ).

     

    post-42-0-26094000-1324774521_thumb.gif

     

    post-42-0-84137600-1324774530_thumb.jpg

  8. Hello.

    Making smooth models from 3DWS is relatively simple, provided that you have UU3D.

    As example this is my pipe model (3dw and gmf):

     

    smooth_pipes_from_3dws.zip

     

    Below I described in a few steps the way, how I do smoothed models with 3D World Studio 5 and Ultimate Unwrap 3D

     

    1. Export your model from 3D World Studio as DirectX (for example pipe.x).
    2. Run Ultimate Unwrap3D and open exported file.
      - Mark "Flip handedness" on import dialog for correct model orientation.
      After opening you may optionally remove unnecessary "World" bone from bone tree.
    3. Menu: 3D Tools -> Modifiers -> Scene -> Scale
      - Set scaling amt. to 0.0078125 (if 128 3DWS units == 1 meter)
      - Set center = Origin
      - Click Apply, then zoom preview a bit.
    4. Menu: 3D Tools -> Weld model
      - click Apply
      After welding all edges are smoothed. If our model should have some sharp edges there are two ways to achieve them.
      You can manually make seams if you want full control of where to sharp edges, or choose the automatic method - in most cases works quite well.
      I chose the automatic method.
    5. Menu: Select -> All
    6. Menu: 3D Tools -> AutoSmooth Faces
      - Set marker by Face normal (optionally you may modify angle, but for me 35 is ok)
      - Click Ok
    7. Save result as for example pipe_smooth.gmf (or other format).

     

    That's it. Below is a few screenshots to illustrate the above method.

     

    Pipes modelled in 3DWS - generally cylinder after some Slice and Extrude operations (and remove unwanted faces).

    post-42-0-46911000-1324423098_thumb.gif

     

    Phases of processing pipes in UU3D

    post-42-0-57084200-1324423109_thumb.gif

     

    Finally - a comparison of pipe exported directly from 3DWS to GMF and processed in UU3D.

    post-42-0-63948400-1324423118_thumb.gif

     

    I hope this helps. ;)

    If someone, who writes English correctly, would like to do mini-tutorial with this, I have nothing against it.

     

    Cheers,

    Lupin

×
×
  • Create New...