Jump to content

Blogs

Real-time Global Illumination

I finally have a cool screenshot to show you of our new real-time global illumination working. Here is a comparison screenshot showing direct lighting only: Now there are still lots of small issues to worry about. Right now I am only using a single cone trace. More cones will improve accuracy, but I think light leaking is just always going to be a fact of life with this technique. Still, the results looks great, require no precalculation, respond to environment changes, and don't require any setup. Win!

Josh

Josh

Cone Step Tracing

Now that we have our voxel light data in a 3D texture we can generate mipmaps and perform cone step tracing. The basic idea is to cast a ray out from each side of each voxel and use a lower-resolution mipmap for each ray step. We start with mipmap 1 at a distance that is 1.5 texels away from the position we are testing, and then double the distance with each steo of the ray. Because we are using linear filtering we don't have to make the sample coordinates line up exactly to a texel center, and it will work fine: Here are the first results when cone step tracing is applied. You can see light bouncing off the floor and reflecting on the ceiling: This dark hallway is lit with indirect lighting: There's lots of work left to do, but we can see here the basic idea works.

Josh

Josh

3D Texture Filled with Voxel Lighting

I have successfully transferred lit voxel data into a 3D texture. The texture is now being used to display the lighting at each voxel. Soft edges are appearing due to linear filtering in the texture. To achieve this, I used an OpenGL 4.2 feature which allows you to write values into any arbitrary position in a texture. This could also be used for motion blur or fluid simulations in the future. However, since Mac support for OpenGL only goes up to 4.1, it means we cannot use real-time GI on a Mac, unless a separate workaround is written to handle this, or unless a renderer is written using Vulkan / Metal. At the time I am going to stick with OpenGL, because it would be too hard to implement an experimental new architecture with an API I don't know much about. Now that we have our lit voxel 3D texture it should be possible to generate mipmaps and begin cone tracing to simulate global illumination.

Josh

Josh

Voxel Direct Lighting on the GPU

We left off on voxels when I realized the direct lighting needed to be performed on the GPU. So I had to go and implement a new clustered forward renderer before I could do anything else. Well, I did that and now I finally have voxel lighting calculation being performed with the same code that renders lighting. This gives us the data we need to perform cone step tracing for real-time dynamic global illumination. The shadows you see here are calculated using the scene shadowmaps, not by raycasting other voxels: I created a GPU timer to find out how much time the lighting took to process. On the CPU, a similar scene took 368 milliseconds to calculate direct lighting. On the GPU, on integrated graphics, (so I guess it was still the CPU!) this scene took 11.61064 milliseconds to process. With a discrete GPU this difference would increase, a lot. So that's great, and we're now at the third step in the diagram below: Next we will move this data into a downsampled cube texture and start performing the cone step tracing that gives us fast real-time GI.

Josh

Josh

Summer Game Tournament Roundup

Here are the results of the Summer Games Tournament. Make sure you update your mailing address, because posters are being sent out immediately! Invade The arcade classic "Space Invaders" has been re-imagined with modern graphics and cute 3D aliens! Constanta Constant is an abstract game about capturing cubes. Make sure you read the instructions! Death Rooms Procedurally generated levels and a lot of interesting rooms make this FPS worth trying. Watch out for traps!  

Josh

Josh

Between The Realities - Announce!

Between The Realities is an indie game in the genre of first-person shooter, which is being developed by our creative association Antology Games Studio. At the moment the game is in active development at the pre-beta stage, the release is expected in the winter of 2019. Our project is entirely inspired by oldschool games of the late 90s, such as Blood and Kingpin: Life of Crime, and by films like Streets of Fire (1984) and Dark City (1998). Annotation:
Another world. Different reality. Different definition of good and evil. Target City is a city in the middle of the Void that has remained from the planet Earth. It's a city controlled by a mysterious cult. Members of the Cult worship the Angels who betrayed the Creator's ideals. Angels are doing experiments on people, trying to teach them to live without their soul, given by a Heaven's energy. But that was before. Because tonight everything will change. The man named Jonathan, who lost memory of his previous life, was chosen by the Creator. He got the soul back and wants to give a freedom for all living citizens... And only one angel, who stayed on the right side, will help him to fight off the dark invaders. They'll win back this city. Together. And even death can’t stop them, because they are balancing between realities...

Voxel Madness

After three days of intense work, I am proud to show you this amazing screenshot: What is so special about this image? I am now successfully uploading voxel data to the GPU and writing lighting into another texture, using a texture buffer object to store the voxel positions as unsigned char uvec3s. The gray color is the ambient light term coming from the Blinn-Phong shading used in the GI direct light calculation. The next step is to create a light grid for the clustered forward renderer so that each light can be added to the calculation. Since voxel grids are cubic, I think I can just use the orthographic projection method to split lights up into different cells. In fact, the GI direct light shader actually includes the same lighting shader file that all the model shaders use. Once I have that done, that will be the direct lighting step, and then I can move on to calculating a bounce with cone step tracing. Clustered forward rendering, real-time global illumination, and physically-based rendering are all going to come together really nicely, but this is definitely one of the hardest features I have ever worked on! Here are a few wacky screenshots from the last few days. Why are half my voxels missing?! Why is only one texture layer being written to?! Ah, finally rendering to six texture layers simultaneously...

Josh

Josh

Shadow Caching

I have shadow caching working now in Turbo. This feature is already in Leadwerks Game Engine 4. The idea is that static scene geometry should not be redrawn when a dynamic object moves. Imagine a character (6000 polys) walking across a highly detailed room (100,000 polys), with one point light in the room. If we mark the scene geometry as static and the character as dynamic, then we can render a shadow map cache of the static scene once. When the character moves, the static cache is copied into the rendering buffer, and then the character is drawn on top of that, instead of re-rendering the entire scene. When used correctly, this will make a huge difference in the amount of geometry the renderer has to draw to update lighting. Here is my test. The helmet spins, causing the point light shadow to re-draw. The surrounding scene is marked as static and consists of 260,000 polys. By using shadow caching we can reduce scene polys rendered from about 540,000 to 280,000, in this case. I actually changed the light type to a point light, which is more demanding since it uses six passes to oover all faces of the cubemap. After performing optimizations, the test runs at 180 FPS, with a point light, with shadow caching enabled. Without shadow caching it ran at about 118. This is with Intel integrated graphics, so a discrete card is sure to be much faster. I also found that using variance shadow maps and multisampled shadows DO make a big difference in performance on Intel graphics (about half the framerate with 4X MSAA VSMs), but I don't think they will make any difference on a high-end card. There is still a bit of an issue with shadow updates syncing with the rendering thread, but all in all it was a good day's work.  

Josh

Josh

Steam Release & Bladequest: Chapter Two!

Hi guys! Bladequest – The First Chapter now finally is on Steam! I am very excited to see how it is going! Check it out if you want! I think it’s pretty cool to have my game on Steam :). Recently I did some redesign and restructuring, affecting my logo, the newsletter and the website. I actually shut the website down and now use another service, which is easier for me to setup and maintain, so I have more capacity to develop Chapter Two! Preproduction and conception for “Chapter Two” (I guess it will have a different name) is nearly finished. With the next installment I am going to make a huge step towards the idea of the final game. I soon will tell you more about it in one of my future videos. Don’t want to miss it? Consider subscribing to my YouTube channel! And as little bonus, here are two shots from some experimenting I did for Chapter Two. What could that be? Markus from Phodex Games! Give Feeback for Bladequest!
My Youtube Channel!
Join the Bladequest Gazette!

Physically-based Rendering

An online implementation of physically-based rendering in the Khronos Github was pointed out to me by @IgorBgz90 and @shadmar. This is very useful because it's an official implementation of PBR that removes a lot of guesswork. Here is my first attempt, which is not using any cubemap reflections: And here it is with cubemap reflections added: I plan to use the real-time global illumination system to generate the reflection data, instead of using environment probes. This will provide more realistic lighting that responds dynamically to changes in the environment. Thanks again to the devs who showed me this, along with the implementation they were working on. Here's one final revision:  

Josh

Josh

Adding LOD to the Model Class

The Model class is being slightly restructured to add support for built-in LOD without the need for separate entities. Previously, a list of surfaces was included in the Model class itself: class Model { std::vector<shared_ptr<Surface> > surfaces; }; This is being replaced with a new LOD class, which allows multiple lists of surfaces containing less detail to be stored in the same model: class LOD { std::vector<shared_ptr<Surface> > surfaces; }; class Model { std::vector<LOD> lods; }; To iterate through all surfaces in the first LOD, you do this: for (int i = 0; i < model->lods[0].surfaces.size(); ++i) { auto surf = lods[0].surfaces[i]; } To iterate through all LODs and all surfaces, you do this: for (int n = 0; n < model->lods.size(); ++n) { for (int i = 0; i < model->lods[n].surfaces.size(); ++i) { auto surf = lods[n].surfaces[i]; } } In the future editor, I plan to add a feature to automatically reduce the detail of a mesh, adding the simplified mesh as an additional LOD level so you can automatically generate these. How this will work with our super-efficient batching system, I am not sure of yet.

Josh

Josh

Bladequest – The First Chapter Conclusion

Hi guys, First of all check out the newest episode of DevTalk, showing some progress of the development of Bladequest: Chapter Two! Bladequest – The First Chapter is available since about one and a half month now and so far and has totally exceeded my expectations with about 2000 downloads in total. It was a very interesting project for me, and I got a lot of positive feedback and you definitely want to see more from Bladequest. I think the foundation is there, to create a really cool game. The First Chapter can be considered as finished now. As far as no major error/bug appears it will not recieve any updates and I will focus on Chapter Two, to be able to deliver much better quality and more content, as seen in The First Chapter. I recognized that the idea behind Bladequest does not get 100% clear when reading the description, or playing the game. It can easily be misunderstood as an episodic game, were in fact it is not. I definitely plan to work on this in the future and also have a cool idea how to very easily show what I have in mind with Bladequest. I am also very exciting to tell you more about the final game concept, as The First Chapter really just is a sneak peek (like a pre-alpha) of what is to come. So to be able to leave Bladequest – The First Chapter with a clear conscience, I gave the website some final touches and released Patch 1.5.0, so I can now focus on Chapter Two. The last exciting thing happening with The First Chapter is the upcoming Steam release. I am really looking forward to this and can’t wait to see how it is going. Thanks for all your support and feedback so far. I am so excited to create Chapter Two you won’t believe it :D, just have to overcome my currently bad health situation :(, to be able to work 24/7 again haha :D. Markus from Phodex Games! Give Feeback for Bladequest!
My Youtube Channel!
Your Games Wishlist so I can craft a game to your needs!

Umbra Sucks. Check out our Easy No-Bake Occlusion Culling

With the help of @martyj I was able to test out occlusion culling in the new engine. This was a great chance to revisit an existing feature and see how it can be improved. The first thing I found is that determining visibility based on whether a single pixel is visible isn't necessarily a good idea. If small cracks are present in the scene one single pixel peeking through can cause a lot of unnecessary drawing without improving the visual quality. I changed the occlusion culling more to record the number of pixels drawn, instead just using a yes/no boolean value: glBeginQuery(GL_SAMPLES_PASSED, glquery); In OpenGL 4.3, a less accurate but faster GL_ANY_SAMPLES_PASSED_CONSERVATIVE (i.e. it might produce false positives) option was added, but this is a step in the wrong direction, in my opinion. Because our new clustered forward renderer uses a depth pre-pass I was able to implement a wireframe rendering more that works with occlusion culling. Depth data is rendered in the prepass, and the a color wireframe is drawn on top. This allowed me to easily view the occlusion culling results and fine-tune the algorithm to make it perfect. Here are the results: As you can see, we have pixel-perfect occlusion culling that is completely dynamic and basically zero-cost, because the entire process is performed on the GPU. Awesome!

Josh

Josh

Constanta entry

Entry for tournament is on 😎 Check game information on link below and tell me this is not an odd game haha. I had  a limited amount of time for this because i go in holiday.Now its done was pretty painful even if i kept things simple , especially the debugging. Has multiplayer , and one way to capture territories. I will continue with this after tournament.   Future plans: Ai clients.
Adding more ways to capture territories. Alerts to players so they know they losing teritories.
Host a single master server for everyone to play.
Add end game and reset server data or increase the worlds count , ive not decided yet. Code cleanup     Cheers

aiaf

aiaf

Workshop car for LE4.5 - ready to drive

I worked today on publishing a version of the drivable car workshop item for Leadwerks 4.5 https://steamcommunity.com/sharedfiles/filedetails/?id=1440937059 free to use, works with the FPS player controller. Here is a demo:   enjoy!  

Marcousik

Marcousik

Accidental Masterpieces

Lighting is nearly complete. and it is ridiculously fast! There are still some visual glitches to work out, mostly with lights intersecting the camera near plane, but it's nearly perfect. I turned the voxel tree back on to see what the speed was, and to check if it was still working, and I saw this image of the level partially voxelized. The direct lighting shader I am using in the rest of the scene will be used to calculate lighting for each voxel on the GPU, and then bounces will be performed to quickly calculate approximate global illumination. This is fun stuff!

Josh

Josh

Introducing new and awesome features!

Check out my latest DevTalk video. I am showing some awesome new features coming to Bladquest – Chapter Two! I really took your feedback serious to develop some cool stuff. So check it out! Give Feeback for Bladequest!
My Youtube Channel!
Your Games Wishlist so I can craft a game to your needs!

Smoothed car drive - Leadwerks 4.5

I'm just happy to get this work  here is a demo: This is actually better than driving in 4.3 because cars are now  able to jump or crash without experimenting crazy rotations or whatever  👍     Here is the script to make this:   > Here the values I used:       > And here what changed: Is written in dark: ------------------------------------- function Script:Start() -- [...........] -- Construit les amortisseurs: / suspensions
local n
local pos
    for n=0,3 do
        pos=self.entity:GetPosition(true)
        self.Axes[n]:SetMass(self.TireMass)
        self.Amortisseurs[n]=Joint:Slider(pos.x, pos.y, pos.z, 0,1,0, self.Axes[n], self.entity)         self.Amortisseurs[n]:EnableLimits()
        self.Amortisseurs[n]:SetLimits(-0.25/2,0.25/2)         self.Amortisseurs[n]:SetTargetAngle(-self.Amort)    --at the middle if 0
        self.Amortisseurs[n]:SetMotorSpeed(10000)    ------------- vitesse de la pompe/ suspensions speed
        self.Amortisseurs[n]:SetStrength(self.Force)    --defatul is 1000
        self.Amortisseurs[n]:EnableMotor()    

    end -- [...........]        -----  I removed the backward suspensions with 2* forces because this only depends on the positions of the suspensions on the chassis. ----- Making them symmetrical is ok to solve this.   ----------------------------------------
function Script:UpdatePhysics()
if self.MyCar==1 and InCar>0 then     
-- Traite la direction:    
local turning=0
    local direction=self.Volants[0]:GetAngle()     if window:KeyDown(Key.Left) then
        direction=direction-5 turning=-1
    elseif window:KeyDown(Key.Right) then
        direction=direction+5 turning=1
    elseif window:KeyDown(Key.Left)==false and window:KeyDown(Key.Right)== false then 
        if Math:Round(direction)>0 then direction=direction-5
        elseif Math:Round(direction)<0 then direction=direction+5
        end
    end
    self.Volants[0]:SetAngle(direction)
    self.Volants[1]:SetAngle(direction) -- Traite l'acceleration: local Gas=0
        if window:KeyDown(Key.Up) then
            Gas=1
            self.currspeed = self.currspeed + 10
            if self.currspeed>self.SpeedMax then
                self.currspeed=self.SpeedMax
            end
        
        elseif window:KeyDown(Key.Down) then
            Gas=-1
            self.currspeed = self.currspeed - 10
            if self.currspeed<-self.SpeedMax then
                self.currspeed=-self.SpeedMax
            end
        end         if Gas==0 then  self.currspeed=0
            for n=0,3 do
            self.Rouages[n]:DisableMotor()
            end
        else
            for n=0,3 do
            if self.Rouages[n]:MotorEnabled()==false then self.Rouages[n]:EnableMotor() end
            self.Rouages[n]:SetTargetAngle(self.Rouages[n]:GetAngle()+1000)             self.Rouages[n]:SetMotorSpeed(self.currspeed)
            self.Tires[n]:SetOmega(self.Tires[n]:GetOmega()*Vec3(5,5,5))   ---------  make the car go faster
            end
        end --Smoothing: if turning==0 then
    self.entity:SetOmega(self.entity:GetOmega()*Vec3(-1,-1,-1))
else self.entity:SetOmega(0,turning*Gas,0) end     self.Axes[0]:SetOmega(self.Axes[0]:GetOmega()*Vec3(-1,-1,-1))
    self.Axes[1]:SetOmega(self.Axes[1]:GetOmega()*Vec3(-1,-1,-1))
    self.Axes[2]:SetOmega(self.Axes[2]:GetOmega()*Vec3(-1,-1,-1))
    self.Axes[3]:SetOmega(self.Axes[3]:GetOmega()*Vec3(-1,-1,-1))     self.Axes[0]:SetVelocity(self.Axes[0]:GetVelocity()*Vec3(1,0.5,1))
    self.Axes[1]:SetVelocity(self.Axes[1]:GetVelocity()*Vec3(1,0.5,1))
    self.Axes[2]:SetVelocity(self.Axes[2]:GetVelocity()*Vec3(1,0.5,1))
    self.Axes[3]:SetVelocity(self.Axes[3]:GetVelocity()*Vec3(1,0.5,1))
-- fake wheels update:
    
        self.Wheels[0]:SetMatrix(self.Tires[0]:GetMatrix())
        self.Wheels[1]:SetMatrix(self.Tires[1]:GetMatrix())
        self.Wheels[2]:SetMatrix(self.Tires[2]:GetMatrix())
        self.Wheels[3]:SetMatrix(self.Tires[3]:GetMatrix())         self.Wheels[0]:SetPosition(self.PosWheels[0]+Vec3(0,self.Amortisseurs[0]:GetAngle()/6,0))
        self.Wheels[1]:SetPosition(self.PosWheels[1]+Vec3(0,self.Amortisseurs[1]:GetAngle()/6,0))
        self.Wheels[2]:SetPosition(self.PosWheels[2]+Vec3(0,self.Amortisseurs[2]:GetAngle()/6,0))
        self.Wheels[3]:SetPosition(self.PosWheels[3]+Vec3(0,self.Amortisseurs[3]:GetAngle()/6,0))
end  

Marcousik

Marcousik

Map Viewer available to subscribers

A map viewer application is now available for beta subscribers. This program will load any Leadwerks map and let you fly around in it, so you can see the performance difference the new renderer makes. I will be curious to hear what kind of results you see with this: Program is not tested with all hardware yet, and functionality is limited.

Josh

Josh

View Your Sales in Leadwerks Marketplace

You can now view detailed sales records of your game assets in Leadwerks Marketplace. First, log into your Leadwerks account and navigate to the Leadwerks Marketplace main page. In the bottom-right, below the categories, a link to your paid files will appear. Here you can see a list of all your paid items: When you click on an item, you can see a list of people who have purchased it, along with sales dates. If you wish to give a free license to any member for any reason, you can do so by clicking the "Generate Purchase" button. A window will pop up where you can type in the member's name and add the item to their account for free. These tools give you more control over your game assets and better information on sales.

Josh

Josh

×