Announcement

Collapse
No announcement yet.

Techdemo for possible Game Engine

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Techdemo for possible Game Engine

    Hi there.
    After many weeks of procrastinating this I am finally back again at trying to build something up with Afterwarp. My hope is to be able to create a new adventure game engine/editor, succesor to my Point & Click Developement Kit made with Asphyre. I thought that maybe sharing my progress will motivate me to spend more time into this and maybe I can even help others with just another example file.

    Current Source and Compiled Example:

    https://zimond.de/AfterwarpDemo.rar

    Whats in it so far:

    - A config file to change several values.
    - A range for aspect ratios can be specified. For example from 4:3 to 16:9 or just 16:9. Black bars will be automaticly added if necessary. The idea is that the app adepts to certain screen sizes, especially when mobile platforms get added to Afterwarp in the future.
    - A bunch of 2D graphics showing all Blendingeffects, Saturation and Hueshift.
    - The UI Layer can be scaled, all graphics are allighted to certain positions of the screen, so a UI can be designed for multiple aspect ratios.
    - The 3d layer currently only contains 2 cubes and a skydome. You can click on the screen and move around spectator style. The skydome is fixed, it only rotates with the mousemovement but you cannot move in it.
    Attached Files
    Last edited by Zimond; 10-16-2021, 12:16 AM.

  • #2


    This is rather pointless but looks cool enough that I thought I share it.
    I played around a little and added some loops to multiply the cubes (to over 18000) and then I let them rotate on all axis around the center. The result was surprisingly neat. After about 4 minutes the cycle ends and it turns back into a big cube but whats more interesting is that within the cycle other shapes appear like 4 smaller cubes.

    Comment


    • #3
      The demo looks very nice. Space cube effect is also looking very good - I think for rendering those you can use instancing to improve performance.

      If you are drawing meshes through TMeshModel.Draw, you can render multiple instances by calling TMeshModel.DrawInstances; however, before doing so, you need to pass instance data to scene object by calling TScene.Instances call (remember to check TScene.InstancesCount for maximum number of instances that can be sent at once). With this, you should be able to render a million of cubes while still retaining reasonable frame rates.

      For rendering cube that has semi-transparent texture, I think it would be best to enable "alpha to coverage" (include StateAlphaToCoverage bit to TRenderingState.States), so instead of alpha-blending, semi-transparent parts will be managed through multisampling.

      Comment


      • #4
        I knew it couldn't be right that 18000 cubes already push my PC down to 60 fps xD. Thanks again.

        Comment


        • #5
          Yes, there is a driver overhead when you issue a draw call (in old days it was called "DrawPrimitive overhead"), so when you render many simple objects individually, your application's performance will be mostly CPU-bound. When you draw instances, it's practically same overhead, except that you can render 128 (or 144, if there are no normals) objects at once, so the overhead per object is 128 times less.

          Comment


          • #6
            I supposed something like that, that there is stuff happening with each Draw Call that would only be necessary if the object to render is a different one. I also exchanged the cubes with the banana model for a test (about 4000 faces) and the fps stayed the same. xD

            Comment

            Working...
            X