Jordan Bonser
  • Home
  • CV
  • University Work
    • Second Year Work >
      • Top-Down Shooter
    • Third Year Work >
      • Terrain Analysis Project >
        • Terrain Analysis Tool
        • Game Demonstration
      • Post Processing
      • Android Application - Sports Centre
  • Projects
    • Unity Development >
      • Lerpz Tutorial
      • Dare to be Digital Entry - "Lit"
      • Unity Game
    • Geometry Instancing
    • Road to Eldorado
    • Level Editor
    • OpenGL Work
    • JBEngine
  • Blog
  • Tutorials
    • Flask Session Timeout

Development Blog

Instancing - Road to Eldorado

23/7/2012

0 Comments

 
After tediously working away getting this instancing working I decided to take a step back and see what I can actually create using instancing. After seeing what low-poly models I could get my hands on I decided to go for a desert theme with some sort of car/spaceship and so I present to you "The Road to Eldorado": 
Okay so it's only a simple game but creating it was quite fun and it really showed me how easy it is going to be to create attractive, detailed environments for my future games or demo's. I'm still going to be carrying out some extra work on this mini-game; adding more features but mainly tweaking the instancing to include non-updated instancing, which essentially means removing instances from the entity list as they are only used on creation and deletion.

I still need to attempt the instancing with rotation and scale but at the moment I'm too interested in playing around with this little mini-game. 
0 Comments

Instancing - Break Through

20/7/2012

0 Comments

 
After a tough couple days working on this I finally managed to get it working. The main reason for the set back is that I was trying to do too much too fast; never a good idea. I was trying to both integrate the instancing with the entity manager and other aspects of the code to ensure it performs with little interaction, whilst at the same time trying to increase the demo to support full matrices rather than just positions. 
After a frustrating few hours debugging code I made a decision to step back a version and try to just implement the integration aspect and use only positions for the models.

Once I had made this decision the code simply fell into place, there was one small hiccup with the pass description but apart from that it all managed to go smoothly. Below is a video of the Instancing which now works using XML to specify which meshes will be instanced. This means that creating large scale environments with many simple models will be a breeze.
As always I'm still not happy with this outcome as there is much more needed to be done. Firstly there is the whole aspect of using the full matrices so that I can use rotation and scale on the models being instanced. This will be much easier now as I'm working with fully working code. There has been a massive performance drop from when I was doing the simple Instancing. This is due to the fact that because the Entity Manager is involved and these models are now entities in the scene the Entity Manager not only has 20,000 more models to iterate through but it also has that many entities to update. There are various ways I may go with this:

1. have a separate list for instanced entities that don't need updating or iterating through.

2. put up with it and accept that 20,000 models is a reasonable amount and still be able to have update functions for these instances.

I'm still undecided on which I will stick with, or I may even do both and use the appropriate one for the situation i.e. if there are lots of stationery objects such as plants, trees, shrubs then use the non-update version and then other for when entity interaction is necessary.

Anyway back to work :)
0 Comments

Instancing - Dealing with Matrices

14/7/2012

0 Comments

 
Over the past week or so I have done little development as I've been roped into various chores such as stripping, sanding and decorating a hallway. When I've had a minute I've managed to do a little progress on my instancing demo. 

Now that I have got the instancing fully working with movement as well there are a few further improvements to be made before it can really be called a success. First of all I have started implementing the instancing to work on placed models within the scene, by collecting the instance information each frame and then passing that to the Instance Buffer. Currently the instancing works by using one model from the scene and using made up position offsets to draw them all. This is impractical and currently only works for one model.

There have been some issues with implementing the new approach, first of all I have had problems passing all the information across to the instance buffer and I believe this will mostly be due to the varying size of the instance buffer from frame to frame. I will more than likely have to check to ensure that the instance data is still the same size or re-create a new instance buffer. 

Once this issue is sorted I should have any model that has been specified as instance-able automatically instancing. The problem with this is that it is only position data that is being passed across to the vertex buffer. I am trying to expand this to include rotation but I am reluctant to send too much data across. The most I can degrade a matrices down to is something like 9 values using cross products to calculate one of the axis on the GPU. 

Anyway I'm hoping to have the major issues out soon so I can post a video, I have also been fiddling around with 3DS Max to try and create some slightly better models. I think a landscape with many small bushes like skyrim would create a rather nice video but we shall see.

Keep it Easy.
0 Comments

Instancing - Dynamic Models

4/7/2012

0 Comments

 
Today I set to work trying to animate the models that have been instanced by updating the information that is already stored in the buffer. I had a look round on the internet to try and find the best method to use as their are various methods such as the Map/Unmap approach or the UpdateSubResource approach. After viewing some various articles online I decided to go with the update method. This is purely because it works with USAGE_DEFAULT buffers which have the fastest GPU read time and allow for me to maximise on the instancing capabilities. Anyway using these methods you can see in the image below some basic movement in which half the models go one way and half the other. Oh and this time there is 100,000 models being instances.

enjoy :)
The next step after this is to fully integrate this into the renderer allowing the scenes to be set up as normal and then instancing the models when and where they need to be. I will also need to think about how the culling will be done. At the moment I've turned the Frustum culling off but this is just for now, I'm not too sure how costly frustum culling all those models will be each frame.
0 Comments

Instancing - "Performance Issues"

2/7/2012

0 Comments

 
So this morning I started looking at where the performance issues seem to be with my instancing. After some profiling and some debugging work I realised that the bottleneck seems to be in a DirectX DLL so either it has been implemented completely wrong or I'm looking at completely the wrong area.

So I made a sausage butty and a brew and came back to the problem at hand. After doing some more debugging I was at a loss, I tried testing the Instanced version against the normal rendering with some other CPU work involved i.e. my third year project. Doing this I found that the AI Demonstration didn't drop the frame rate at all whilst instancing but did significantly in the naive rendering approach. 

And finally after nearly writing it off as a failure I though to check the .x file of the model I was using. To my surprise the "simple" sphere model I was using had 1600 polygons. Why?? Anyway I changed it to a 16 polygon diamond I had created in MAX and the results were amazing. Below is an image of the Instanced Diamonds; All 70,000 of them, and there is still 100 FPS with my Project running in the background.
Picture
0 Comments

Instancing - Accomplished

2/7/2012

0 Comments

 
Yes. Finally got it working, turns out although I was adding the extra input elements I never incremented the number of elements that were used on creation. This mean that the creation of the Vertex Input Layout failed and meant that nothing was being rendered at all.

Picture
Now in the image you can see the instancing being performed to create 7,000 models in one draw call. There does seem to be some rather large performance issues with this. For tonight this will do as it's much easier to optimise something that works. Extremely relieved to finally get this working.

Take it easy. 
0 Comments

Geometry Instancing - Not Going Well

2/7/2012

0 Comments

 
Today I have started trying to do geometry instancing to considerably reduce the number of draw calls needed when drawing lots of the same model. 

So far the development has not been going well at all, I have Initialised all the vertex buffers that are going to be used and adjusted the Vertex Layout Description to accommodate for the extra per instance input element "POSITION". I have also set both buffers to the IA stage along with the correct technique and for some reason there is absolutely nothing being rendered at all. I am going to be looking further into the problem to try and find out exactly where I am going wrong. 
0 Comments

    Archives

    May 2020
    April 2020
    January 2020
    November 2019
    October 2019
    September 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019
    February 2019
    August 2018
    July 2018
    June 2018
    March 2018
    January 2018
    June 2017
    February 2017
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    February 2016
    January 2016
    December 2015
    November 2015
    September 2015
    August 2015
    July 2015
    June 2015
    March 2015
    January 2015
    November 2014
    October 2014
    September 2014
    August 2014
    July 2014
    June 2014
    May 2014
    February 2014
    January 2014
    December 2013
    November 2013
    October 2013
    July 2013
    June 2013
    May 2013
    April 2013
    March 2013
    February 2013
    January 2013
    December 2012
    October 2012
    September 2012
    August 2012
    July 2012
    June 2012
    May 2012

    Categories

    All
    2D
    3rd Year Project
    Agile
    Android
    Angular
    Animation
    API
    Apple
    Apps
    Arden
    Async
    Awesomium
    C#
    CI/CD
    Clean Code
    CMake
    Cocos2d-x
    Colour Match
    Compilers
    Cross Compiling
    Cross-Compiling
    Databases
    Design
    Development Tools
    Docker
    Electronics
    Examples
    Flask
    Flask-Login
    Fmod
    Game Development
    Godot
    GUI
    Hackathon
    Hacktoberfest
    Hardware
    Home Life
    IBM
    Inspired Gaming
    Instancing
    Ios
    Javascript
    Jbengine
    Kata
    Level Editor
    Linux
    Microsoft
    Mobile Development
    Monogame
    Moodster
    Motivation
    Networking
    Objective C
    Opengl
    Open Source
    Organisation
    Physics
    Physx
    Pi
    Planning
    Post Mortem
    PyGame
    Python
    Quart
    Quasar
    RakNet
    React
    Road To Eldoarado
    Scripting
    Scrum Master
    Sessions
    Session Timeout
    Social
    Sound
    Space Invaders
    Squash Game
    Squash Game
    Streaming
    TDD
    Team Leading
    Test
    Test Driven Development
    Travis
    Unity
    Unity Development
    VSCode
    Vulkan
    Web Applications
    Worklife
    WSL
    XML
    XNA / C#

    RSS Feed

Powered by Create your own unique website with customizable templates.
  • Home
  • CV
  • University Work
    • Second Year Work >
      • Top-Down Shooter
    • Third Year Work >
      • Terrain Analysis Project >
        • Terrain Analysis Tool
        • Game Demonstration
      • Post Processing
      • Android Application - Sports Centre
  • Projects
    • Unity Development >
      • Lerpz Tutorial
      • Dare to be Digital Entry - "Lit"
      • Unity Game
    • Geometry Instancing
    • Road to Eldorado
    • Level Editor
    • OpenGL Work
    • JBEngine
  • Blog
  • Tutorials
    • Flask Session Timeout