Jump to content

Josh

Staff
  • Posts

    23,141
  • Joined

  • Last visited

Blog Entries posted by Josh

  1. Josh
    An update is available on the beta branch. This adds an optional recursive parameter to the Entity::SetCollisionType command and updates the MonsterAI script so that not so many special settings need to be adjusted to make enemies work.
  2. Josh
    An update is available on the beta branch which makes changes to the way DLCs are installed. The SciFi Interior Pack has been added as a paid Workshop item. You can obtain this item by either purchasing it through the Workshop Store interface, or buying the DLC on our Steam Store page. At the time of this writing, the other model pack DLCs have not been added yet.
     
    To install the SciFi Interior Pack DLC you simply browse to it in the Workshop interface. If you own the DLC the "Buy" button will say "Install" and allow you to install the item. The "Subscribed Items" tab has been removed completely.
     

     
    We have found that customers overwhelmingly prefer to purchase DLCs through the Steam store, and do not purchase Workshop store items at nearly the same rate. These changes allow us to simplify the install process and will allow us to "promote" Workshop items to DLCs, where they will get good sales.
     
    I don't understand the reason for this behavior, but there is more than a 10x difference in sales.
  3. Josh
    An update is available on the beta branch with the following changes:
    Fixed System::Print() command which was printing char* values as bools.
    Added optional parameter to the end of Entity::SetInput().
    Add optional parameter to the end of Emitter::SetVelocity()
    Fixed light occlusion culling bug.
    Fixes a sound source position bug.

  4. Josh
    An update is available on the beta branch. This adds the Window::Center style back into the new refactored Window class, and adds a missing header file in the Professional Edition.
     
    If you'd like to try out a basic implementation of the new GUI, download and extract the attached scripts:
    Scripts.zip
     
    This code will create a GUI on the rendering context. It simply consists of a solid background filling the screen and a textless button.

    --Initialize Steamworks (optional) Steamworks:Initialize() --Set the application title title="test" --Create a window local windowstyle = window.Titlebar + window.Resizable if System:GetProperty("fullscreen")=="1" then windowstyle=windowstyle+window.FullScreen end window=Window:Create(title,0,0,System:GetProperty("screenwidth","1024"),System:GetProperty("screenheight","768"),windowstyle) --window:HideMouse() --Create the graphics context context=Context:Create(window,0) if context==nil then return end --Create a world world=World:Create() world:SetLightQuality((System:GetProperty("lightquality","1"))) --Load a map local mapfile = System:GetProperty("map","Maps/start.map") if Map:Load(mapfile)==false then return end --Create a GUI local gui = GUI:Create(context) gui:GetBase():SetScript("Scripts/GUI/Panel.lua") local widget = Widget:Create(20,20,75,30,gui:GetBase()) widget:SetScript("Scripts/GUI/Button.lua") while window:KeyDown(Key.Escape)==false do --If window has been closed, end the program if window:Closed() then break end --Handle map change if changemapname~=nil then --Clear all entities world:Clear() --Load the next map Time:Pause() if Map:Load("Maps/"..changemapname..".map")==false then return end Time:Resume() changemapname = nil end --Update the app timing Time:Update() --Update the world world:Update() --Render the world world:Render() --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 --Refresh the screen context:Sync(true) end
     
    This code will create the same GUI directly on the window, with no rendering context initialized, using the native OS drawing commands:

    --Initialize Steamworks (optional) Steamworks:Initialize() --Set the application title title="test" --Create a window local windowstyle = window.Titlebar + window.Resizable if System:GetProperty("fullscreen")=="1" then windowstyle=windowstyle+window.FullScreen end window=Window:Create(title,0,0,System:GetProperty("screenwidth","1024"),System:GetProperty("screenheight","768"),windowstyle) --window:HideMouse() --Create a GUI local gui = GUI:Create(window) gui:GetBase():SetScript("Scripts/GUI/Panel.lua") local widget = Widget:Create(20,20,75,30,gui:GetBase()) widget:SetScript("Scripts/GUI/Button.lua") while window:KeyDown(Key.Escape)==false do --If window has been closed, end the program if window:Closed() then break end end
     
    The second example isn't really useful for games, but it will allow me to build a cross-platform UI for our own tools, and create an official GUI for in-game use, all in one step.
  5. Josh
    An update is available on the beta branch. This only updates the editor, only on Windows.
     
    The environment probe entity should now be available to create in the editor, for all users.
     
    When shaders are compiled with the "Debug" button (F5) they will now be run through the GLSlang reference compiler first. This can help to catch errors that more permissive hardware lets slide by (Nvidia). The goal of this is to prevent games from not working on AMD and Intel hardware when they use third-party shaders. GLSlang does not catch deprecated functions like texture2D() but it may catch some other errors Nvidia cards ignore.
  6. Josh
    An update is available on the beta branch. This includes all recent bug fixes, and is a full build with C++ libs for Windows and Linux.
     
    The following header search path needs to be added to your Visual Studio projects:
    $(LeadwerksHeaderPath)\Libraries\glslang
  7. Josh
    A new build is available on the beta branch on Steam. This updates everything, C++ and Linux included.
     
    A bug where the editor skipped navmesh calculation on brushes is fixed.
     
    We're updated to the latest version of the Steamworks SDK, which may fix some Workshop upload and download issues.
     
    Animation now calculates more than twice as fast as previously. This was achieved by optimizing the animation code, implementing some inline functions, and by changing the way the matrix updating works. The UnlockMatrix() command will now accept a single integer parameter for the update type. Zero will perform no updating. This should only be used if the entity's 4x4 matrix has been manually set. (So really, it should never be used by you.) 1 is the default setting which updates the entity's bounding boxes, octree node, etc. 2 is used to only update the entity's 4x4 matrix, which is much faster.
     
    The animation manager script is modified to use the fastest method on bones:

    --Unlock entity matrix if any animations were applied if doanimation==true then self.entity:UnlockMatrix(2) end
     
    If you are using large numbers of animated characters, another easy way to make things even faster is to only animate them every Nth frame. If you have a large number of characters the lack of continuous motion each frame won't really be noticeable.
     
    Update your project to get the latest Steamworks DLL.
  8. Josh
    I've updated the beta branch with a full build to address the following issues:
    GI / water bug where everything would get brighter (the blend mode wasn't being reset to "solid").
    "Cannot blit backbuffer" bug fixed.
    VC .usr file added back into template, which contains info on the default working directory. This is why games weren't launching in the right directory.
    SDK version set to 8.1 since the 10 SDK isn't installing on Windows 7 (what I'm on now).

     
    FYI, I tested on an AMD card and there were not any AMD-related errors in the previous build.
  9. Josh
    An update is available on the beta branch on Steam. This only updates the compiled executables for Lua, only on Windows.

    Optimization
    I've rewritten the way lights and objects affect each other. In the old mobile renderer it was necessary to store a list of lights that affect each entity, because it was using a forward renderer and had to send the information for the nearest four lights to the object's shader to calculate lighting. This was a complicated task and is not needed with a deferred renderer. 
    The C++ PlayAnimation routine had a bug that would cause the animation to keep updating invisibly, causing shadows to continue rendering when they did not need to be. This is fixed.
     
    I also fixed some inefficiency that would affect point and spot lights, even if their shadows were not being updated.
     
    Finally, I set it so that in medium and low quality lighting modes, only one shadow will be updated per frame, unless the player is close to the shadow volume. This allows you to have many lights updating but only one gets their shadowmap redrawn each frame. This can cause some small visual glitches but the high quality setting (World:SetLightQuality(2)) can be used to always render everything.
     
    Performance Benchmarks (4.3 beta vs 4.1/4.2)
    One more Day: 15% faster
    A Demon's Game: 17% faster
    The Garden: 20% faster
    Vectronic: 23% faster
    AI and Events map: 200% faster

     
    This build should be considered unstable. It will crash on some games.
  10. Josh
    A new build is available on the beta branch. The editor and Lua executables are updated, only on Windows at this time. Everything is updated, including the beta branch of Game Launcher, for Windows and Linux.
     
    I believe I have fixed the crashing in the new light management code. I also added a small optimization that checks if a moved light has the same 4x4 matrix it did at the time of the last shadow render. This makes it so if you are standing still and nothing is moving, the flashlight shadow won't update unnecessarily, even though your code is repositioning it each frame. This is a very small improvement, but I want your games to run as fast as possible.
     
    I've added experimental support for frame limiting. This works by passing a second optional parameters to the Context:Sync command specifying the max framerate. This can be used alone to cap the framerate without VSync:

    context:Sync(false,60)
     
    It can be used to cap the framerate at any arbitrary speed:

    context:Sync(false,90)
     
    Or it can be used together with VSync enabled to cap the framerate and prevent screen tearing:

    context:Sync(true,60)
     
    This is experimental, and may change before the final release of version 4.3.
  11. Josh
    An update is available on the beta branch for Windows, editor and Lua executables only. This fixes a problem in the new light update system:
    http://www.leadwerks.com/werkspace/topic/15713-shadow-update-editor-issues/
    http://www.leadwerks.com/werkspace/topic/15716-43-child-entities-do-not-cast-shadows/
     
    The animation shaders are also modified and they will appear better:
    http://www.leadwerks.com/werkspace/topic/15710-all-animated-shaders-have-wrongstatic-normals/
  12. Josh
    I've updated the editor and Lua executables on Windows with the following fixes:
    http://www.leadwerks.com/werkspace/topic/15399-rc4-editor-hints-get-built-in-probe-reflections/
    http://www.leadwerks.com/werkspace/topic/15646-prefabs-child-entity-scripts-start-function-not-called/
    http://www.leadwerks.com/werkspace/topic/15644-latest-43-beta-causes-crawler-to-rotate-at-wrong-direction/
    http://www.leadwerks.com/werkspace/topic/15593-releasecleanup-vehicle-error/
     
    The game launcher beta branch for Windows has also been updated. If all goes well, 4.3 will be released next week.
  13. Josh
    An update is available on the beta branch, which includes the editor and Lua executables, for Windows only. The following issues are resolved:
    http://www.leadwerks.com/werkspace/topic/14934-materials-go-crazy-when-used-on-a-prefab/
    http://www.leadwerks.com/werkspace/topic/15644-latest-43-beta-causes-crawler-to-rotate-at-wrong-direction/
    http://www.leadwerks.com/werkspace/topic/15597-wrong-issues-with-z-sort-materials/#entry104462
  14. Josh
    An update to 4.3 is available on the beta branch. This fixes it so the editor is not DPI-aware and will be scaled correctly if scaling on Windows is used. This build is also built with a fresh install of Windows 10 and Ubuntu (but it shouldn't make any difference).
     
    This is a full build for Windows and Linux, with C++ libraries included. Game Launcher is also updated on its beta branch.
     
    If there are no problems with this, it will go onto the default branch in a couple days.
  15. Josh
    A full update for Windows and Linux is now available on the beta branch which addresses several small problems:
    http://www.leadwerks.com/werkspace/topic/15772-standalone-build-wont-launch/
    http://www.leadwerks.com/werkspace/topic/15761-entity-gets-has-stopped-working-error/
    http://www.leadwerks.com/werkspace/topic/15766-crash-anything-since-last-update-object-already-deleted/
     
    The version of the VC redistributable has also been updated in Steam and will fix this problem if you are having trouble running your game from the editor in debug mode:
    http://www.leadwerks.com/werkspace/topic/15734-problem-starting-43-in-debug-mode/
  16. Josh
    An update is available on the beta branch on Steam.
    Fixed missing fall damage: https://www.leadwerks.com/community/topic/17005-i-dont-get-fall-damage/ Fixed LoadAnimation bug: https://www.leadwerks.com/community/topic/16982-modelviewer-load-animation/ May have fixed VR player script and tracking on Oculus Rift. If you have an Oculus Rift please try creating a new project from the VR template project and tell me your results. If there is still a problem I will go buy an Oculus headset, but OpenVR should make all headsets work correctly without testing each one.
  17. Josh
    An update is now available on the beta branch.
     
    A new decal entity type is available. Decals are used to project an image into surrounding geometry. A decal requires a material using a decal shader, located in the "Shaders\Decals" folder. The FPSGun.lua script has been updated to add bullet marks and gunshot wounds to objects a bullet hits. You can also place a decal in a map for adding large details to walls, terrain, or anything else.
     

     
    Decals are rendered similarly to the way a deferred light works; they are rendered onto the screen gbuffer. This allows them to work on any geometry, including animated models and GPU-generated details like tessellation. They will also map onto any surface, based on the direction of the surface normal. There are two new commands, Decals::Create() and Decal::SetRenderMode().
     
    Because decals render onto the scene gbuffer, a way to differentiate pixels is needed. Otherwise, a scene decal will appear on objects that pass through that area. The Decal::SetRenderMode(int mode) command can be used to indicate whether a decal should be a static scene decal (mode=0) or a dynamic decal, like for a bullet mark (mode=1). Materials also have a new parameter for their decal mode, which can be 0 (static), 1 (dynamic), or 2 (none).
     
    The blending of decals required that I modify the channel allocation of the gbuffer, and the lighting and model shaders have changed. Previously, data was stored like this:
    0: Diffuse RGBA
    1: Normal XYZ, specular
    2: Emission RGB, material flags
     
    Now the gbuffer is storing information as follows:
    0: Diffuse RGBA
    1: Normal XYZ, material flags
    2: Emission RGB, specular
     
    Any modified model shaders or shaders that are rendered before lighting need to be changed to accommodate this change, as well as any post-processing effects that read the specular value or material flags.
     
    Particle emitters will now use simple collision if the emitter has a collision type other than zero. This is a nice touch that makes bullet shrapnel bounce off floors instead of going straight through.
     
    I previously talked about four big features I was researching, terrain tessellation, terrain horizontal offsets, deferred decals, and vegetation. I made headway on each of these, but discovered that deferred decals were fairly easy to wrap up, while the other three features were more involved. Based on this development, I am revising my plan to release a new version in August with decals and the other recent improvements, then focus on finishing the vegetation system for a subsequent update. The important thing is to have the final update with vegetation out by November 1, at the latest, although that could end up being much sooner if things go smoothly.
     
    I also expect to release the game launcher in August, as an early preview release on Steam.
     
    (Build #691949 was update to #711604.)
  18. Josh
    An update is available on the beta branch with the following changes:
    Implemented "CollisionMesh"-named limbs in models.
    Added "Strip vertex colors" option in model editor.
    Workshop items can now be submitted as free or curated paid items, although no mechanism is in place yet to actually purchase items.

     

     
    Curated items appear in the Workshop and can be voted for, but cannot be downloaded.
     

     
    You can enter your bank information for receiving payments, and you can even create a revenue split between multiple people.
     

     
    Although purchasing items is not yet supported, this is a first step that allows you to prepare for when it is implemented. Any paid items you submit will be viewable, but cannot be used or downloaded by other users yet.
  19. Josh
    Ultra Engine makes much better use of class encapsulation with strict public / private / protected members. This makes it so you can only access parts of the API you are meant to use, and prevents confusion about what is and isn't supported. I've also moved all internal engine commands into separate namespaces so you don't have to worry about what a RenderMesh or PhysicsNode does. These classes won't appear in the intellisense suggestions unless you were to add "using namespace UltraRender" to your code, which you should never do.
    There's still a lot of extra stuff intellisense shows you from Windows headers and other things:

    Using the __INTELLISENSE__ macro in Visual Studio, I was able to trick the intellisense compiler into skipping include files that link to third party libraries and system headers the user doesn't need to worry about. This strips all the unnecessary stuff out of the API, leaving just basic C++ commands, some STL classes, and the Ultra Engine API. With all the garbage removed, the API seems much friendlier:

    This is one more detail that I feel helps make C++ with Ultra Engine about as easy as C# programming. You can disable this feature by adding _ULTRA_SIMPLE_API=0 in your project macros.
  20. Josh

    Articles
    My initial implementation of mesh voxelization for ray tracing used this code. It was good for testing, but has some problems:
    It's slow, using an unnecessary and expensive x * y * z loop No support for per-voxel color based on a texture lookup There are mathematical mistakes that cause inaccuracy, and the math has to be perfect My solution addresses these problems and only uses an x * y loop to generate the voxels. It does this by identifying the major (largest magnitude) axis of the triangle normal and using the other two axes for the X and Y axis, then finding the Z position of the triangle at each grid point along the surface.
    In previous screenshots, you could see some black faces that were caused by geometry that lies outside the bounds of the voxel geometry. Some of this was caused because I was voxelizing the mesh in local space and then transforming the resulting voxels to world space. That doesn't work, because the voxel position can end up rounding off to a different coordinate than the triangle it's supposed to enclosed. The best solution is to have a low-res LOD model that is used to generate the voxel data. (It's important to make sure the voxel geometry still contains the full-resolution model.)
    In the shot below you can see every single surface has a voxel to retrieve the color from. There are no texture lookups being performed in this shot, just colored voxels that were generated by reading the image pixel at each voxel position and then stored in a GPU buffer.

    This means we can safely calculate which lights are visible at each voxel and store those light IDs in a texture to be retrieved instead of performing a shadowmap lookup. It also means we can calculate global illumination at each voxel, store it in a texture, and just do a single texture lookup to grab the GI lighting when the actual model is rendered, instead of calculating GI each frame.
    Onwards and upwards!
  21. Josh
    With the main culling and rendering algorithm done, I am focusing on the billboard display for the Leadwerks 3.7 vegetation system. My goal is to reduce the popping artifacts the Leadwerks 2 renderer displayed:

     
    I am testing with a non-plant model with the idea that if I can get it to look reasonably well with an oddly sized mechanical object with highly visible lines, then a tree should look very good. Below you can see part of the billboard image drawn on the screen showing the object rendered from different angles.
     

     
    The 3D model is being :"faded" in and out by discarding random pixels. I will attempt to fade the various billboard faces as well to make a smooth transition between viewing angles.
     

  22. Josh
    I tried a different approach for billboards that is giving good results. A single quad rotates around the vertical axis to face the camera. A series of 64 different view angles are rendered in a circle around the billboarded object. A second quad faces straight up and is gradually dissolved in when the angle between the object and the camera becomes vertical enough.
     
    A combination of cross-fading and cross-dissolving is used to smoothly blend in between the different side views. The billboard itself is dissolved in as the 3D model is dissolved out. The net result is perfectly smooth blending between distances and view angles. The billboard representation of the model is extremely accurate and has much better lighting than Leadwerks 2 vegetation system had.
     
    A couple of things I also had to do:
    Activate alpha filtering in the mipmap generation routine in the texture converter. This will make tree branches look a lot better.
    Add the ability to render to a specific mipmap of a texture. Works nicely!

     
    There's still a lot to do, but the idea is starting to sprout.
     

  23. Josh
    The clustered forward renderer in Leadwerks 5 / Turbo Game Engine required me to implement a texture array to store all shadow maps in. Since all shadow maps are packed into a single 3D texture, the shader can access all required textures outside of the number of available texture units, which only gives 16 guaranteed slots.
    I realized I could use this same technique to pack all scene textures into a few arrays and completely eliminate the overhead of binding different textures. In order to do this I had to introduce some restrictions. The max texture size, by default, is 4096x4096. Only two texture formats, RGBA and DXT5, are supported. Other texture formats will be converted to RGBA during loading. If a texture is smaller than 1024x1024, it will still take up a layer in the 1024x1024 texture array.
    This also makes texture lookups in shaders quite a bit more complicated.
    Before:
    fragColor *= texture(texture0,texcoords0); After:
    fragColor *= texture(textureatlases[materialdefs[materialid].textureslot[0]],vec3(texcoords0,materialdefs[materialid].texturelayer[0])); However, making shaders easy to read is not a priority in my design. Performance is. When you have one overarching design goal these decisions are easy to make.
    Materials can now access up to 256 textures. Or however many I decide to allow.
    The real reason for this is it will help support my goal to render the entire scene with all objects in just one or a few passes, thereby completely eliminating all the overhead of the CPU/GPU interaction to reach 100% GPU utilization, for ultra maximum performance, to eliminate VR nausea once and for all.
    Also, I went out walking yesterday and randomly found this item in a small shop.

    There's something bigger at work here:
    Most of my money comes through Steam. Valve invented the technology the HTC Vive is based on. Gabe Newell gave me the Gigabyte Brix mini PC that the new engine architecture was invented on. The new engine makes VR performance 10x faster. If this isn't a clear sign that divine providence is on our side, I don't know what is.
×
×
  • Create New...