Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

8,932 Excellent

About JMK

  • Rank
    Advanced Member

Profile Information

  • Gender
  • Location
    San Francisco, CA

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. A new update is available to beta testers. This makes some pretty big changes so I wanted to release this before doing any additional work on the post-processing effects system. Terrain Fixed Terrain system is working again, with an example for Lua and C++. New Configuration Options New settings have been added in the "Config/settings.json" file: "MultipassCubemap": false, "MaxTextures": 512, "MaxCubemaps": 16, "MaxShadowmaps": 64, "MaxIntegerTextures": 32, "MaxUIntegerTextures": 32, "MaxCubeShadowmaps": 64, "MaxVolumeTextures": 16, "LuaErrorCommand": "code", "LuaErrorCommandArguments": "-g \"$(CurrentFile)\":$(LineNumber) \"$(AppDir)\"" The max texture values will allow you to reduce the array size the engine requires for textures. If you have gotten an error message about "not enough texture units" this setting can be used to bring your application down under the limit your hardware has. The Lua settings define the command that is run when a Lua error occurs. By default this will open Visual Studio code and display the file and line number an error occurs on. String Classes I've implemented two string classes for better string handling. The String and WString class are derived from both the std::string / wstring AND the Object class, which means they can be used in a variable that accepts an object (like the Event.source member). 8-bit character strings will automatically convert to wide strings, but not the other way. All the Load commands used to have two overloads, one for narrow and one for wide strings. That has been replaced with a single command that accepts a WString, so you can call LoadTexture("brick,dds") without having to specify a wide string like this: L"brick.dds". The global string functions like Trim, Right, Mid, etc. have been added as methods on the two string classes, Eventually the global functions will be phased out. Lua Integration in Visual Studio Code Lua integration in Visual Studio Code is just about finished and it's amazing! Errors are displayed, debugging works great, and console output is displayed, just like any serious modern programming language. Developing with Lua in Leadwerks 5 is going to be a blast! Lua launch options are now available for Debug, Release, Debug 64f, and Release 64f. I feel the Lua support is good enough now that the .bat files are not needed. It's easier just to open VSCode and copy the example you want to run into Main.lua. These are currently located in "Scripts/Examples" but they will be moved into the documentation system in time. The black console window is going away and all executables are by default compiled as a windowed application, not a console app. The console output is still available in Visual Studio in the debug output, or it can be piped to a file with a .bat launcher. See the notes here on how to get started with VSCode and Lua.
  2. Wow! I've got error handling with Lua in VSCode working now and it's so good! Makes Lua feel like a "real" language.

  3. SSAO in Vulkan:


  4. A new update is available that adds post-processing effects in Leadwerks 5 beta. To use a post-processing effect, you load it from a JSON file and apply it to a camera like so: auto fx = LoadPostEffect("Shaders/PostEffects/SSAO.json"); camera->AddPostEffect(fx); You can add as many effects as you want, and they will be executed in sequence. The JSON structure looks like this for a simple effect: { "postEffect": { "subpasses": [ { "shader": { "vertex": "Shaders/PostEffects/PostEffect.vert.spv", "fragment": "Shaders/PostEffects/SSAO.frag.spv" } } ] } } Multiple subpasses are supported for custom blurring and chains of shaders. This Gaussian blur effect uses several intermediate buffers to blur and downsample the image: { "postEffect": { "buffers": [ { "size": [0.5, 0.5] }, { "size": [0.25, 0.25] }, { "size": [0.125, 0.125] } ], "subpasses": [ { "target": 0, "shader": { "vertex": "Shaders/PostEffects/PostEffect.vert.spv", "fragment": "Shaders/PostEffects/blurx.frag.spv" } }, { "target": 1, "shader": { "vertex": "Shaders/PostEffects/PostEffect.vert.spv", "fragment": "Shaders/PostEffects/blury.frag.spv" } }, { "target": 2, "shader": { "vertex": "Shaders/PostEffects/PostEffect.vert.spv", "fragment": "Shaders/PostEffects/blurx.frag.spv" } }, { "shader": { "vertex": "Shaders/PostEffects/PostEffect.vert.spv", "fragment": "Shaders/PostEffects/blury.frag.spv" } } ] } } A new file is located in "Config/settings.json". This file contains information for the engine when it initializes. You can specify a default set of post-processing effects that will automatically be loaded whenever a camera is created. If you don't want any post-processing effects you can either change this file, or call Camera::ClearPostEffects() after creating a camera. Customizable properties are not yet supported but I plan to add these so you can modify the look of an effect on-the-fly. Fixed physics bug reported by @wadaltmon Other changes: EnablePhysics is renamed to SetPhysicsMode. EnableGravity is renamed to SetGravityMode. EnableSweptCollision is renamed to SetSweptCollision. COLLISION_CHARACTER is renamed to COLLISION_PLAYER
  5. Insane Apple switching Mac to ARM chips (not joking): https://appleinsider.com/articles/20/06/19/how-to-play-games-on-an-arm-mac

    1. Show previous comments  3 more
    2. reepblue


      On the upside, developing for ARM processors will be less of a nightmare since the development machine will be on the same processor as mobile devices. 

      I'm curious on your plans with this as you were very interested in macOS for the education market.But to be honest, I don't think all those institution are going to be jumping to the new machines on Day one. (My School was still using iMac G5's until 2012!) 

    3. JMK


      I have no idea. Either way, I think porting Leadwerks 5 to Mac will be much easier than 4 would have been, and 3 was. There is no reliance on OpenGL, x86, or Blitz anymore.

      It will work but not being able to play Portal 2 on an iMac is a major buzzkill. Those two things went together so well.

      My old iMac was the best user experience I ever had. It's miles ahead of the laptops. So many little cool things it did. Don't know if I really want a 27" iPhone.

    4. JMK


      This also means we could very well see Leadwerks 5 running on an iPad. The whole editor.

  6. The collision type doesn’t affect the behavior though, that is just a filter for collision.
  7. No, the player controller does not use the same physics as normal rigid bodies.
  8. I've got SSAO working in Vulkan now.
  9. It took three days but I've got a basic post-processing effect working with Vulkan now: 🤪
  10. The new engine uses a fixed time step in the main loop.
  11. Yes, that is the same functionality, although I don't think you have have a global variable like that in a shader, unless you use atomics, which you almost certainly do not want to do. It's also best to do things on a time basis. You will always get the current time in the shader, but setting variables each frame can be problematic because for every game update, you might have 2-3 frames rendered in the rendering thread. So values changing smoothly would not be exactly smooth. It's better to set a start and stop time, and let the shader do the interpolation based on the current time, which is updated each render frame.
  12. I am working out the details now, but that should be doable.
  13. I believe the subpass approach described above would cover that case, because you can copy the contents of the framebuffer to another image and then access that image the next frame.
  • Create New...