Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by Josh

  1. If you just upload one of those models I am sure it has something drastically wrong with it, like 100 different subobjects each.
  2. Itโ€™s more optimal for us to make a decision now than for everyoneโ€™s GPUs to make a decision for each pixel, for each frame ever rendered by this engine, on anyoneโ€™s computer. ๐Ÿ˜„
  3. Josh

    PBR in LW4

    There are some difficulties with this. The gbuffer would require an additional value and it might be full right now. All the light shaders would require revision, with one logical branch handling pbr and another for blinn. Only one single brdf could be used. The probe shaders would also require revision. The new renderer is better suited for this. It might be possible, but I would rather spend this time working out transparency and other details in the Vulkan renderer.
  4. I would be interested in seeing your project files. Your scene does not look very complex
  5. Are your boxes instanced? How are they being created?
  6. This should be required for every single normal map that anyone imports into the engine, ever.
  7. It is very restrictive to have X, Y, and Z, correlate to R, G, and B. There may be a mentally impaired and color-blind person in Borneo who prefers to make the green channel represent the Z component of the vector.
  8. We should have the same thing for normal maps. All normal maps should require a visual editor to decide which channel represents the x, y, and z attributes. It would give us more options.
  9. So we all drag a bunch of lines between squares that represent color channels because we canโ€™t make up our minds where to store each value? ๐Ÿคฃ
  10. Also regarding height, why is it not just common practice to pack height into the alpha channel? I have never seen displacement maps with more than one component.
  11. What is the Blender layout? Allegrorithmic seems to prefer RGB occlusion/rough/metal although I canโ€™t get a straight answer and no one seems to have any idea at all.
  12. I could add a texture swizzle in the material file like this: "swizzle": "bgra" But simplest is best. It can take forever to import a bunch of materials one-by-one. I can't believe people actually go through and drag lines between color channels for EVERY SINGLE MATERIAL they import. A visual tool will be a necessity in the future, but that is part of the editor.
  13. Idea: Use AI to guess the texture files to use for diffuse / normal / roughness / specular / etc.

    1. IgorBgz90


      By prefix? (_color, _nrm, _spec) Good idea.

    2. Genebris


      No, I'm too lazy to name them properly. Make itย  analyze content of the texture to decide. ๐Ÿ˜‰

    3. wadaltmon


      I guess as a combination of the two previous comments. Do you mean by name or by image content? If the latter, I guess it would be fairly simple to tell a normal map vs a diffuse map given their different color spectra, but how would you be able to differentiate a diffuse map v. a specular map, or a metallic map v. a roughness map?

  14. Disable VSync. It's locked at 60 FPS.
  15. I need to decide on a channel layout for PBR materials. There are four images to consider: metallic, roughness, occlusion, and height. These could be packed into a single RGBA texture. From the GLTF spec here: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#metallic-roughness-material I keep seeing people asserting that GLTF stores occlusion in the red channel, but the spec says it is a separate texture. So there does not seem to be any standard at all, as far as I can see. What do you think is best to do here?
  16. The space will not cause problems. The first time you run Leadwerks it will ask to create a project. You did not mention this, and I am not sure if this occurred or not. The fact that it is loading from the Projects directory, and not from Projects/SomeSubfolder, is perplexing. I recommend you look for a file in your Documents\Leadwerks folder called "Leadwerks.cfg" and delete it, then start again.
  17. Josh

    Open Meshes?

    As far as I know, only stencil shadow engines have this restriction. Shadowmaps, as we use, do not.
  18. Itโ€™s a 3D texture, a 3D grid of blocks.
  19. Go to "Edit Profile" on your profile page and there is an option to enable status updates.
  20. Here's a nice shot showing the quality BC5 brings to normal maps:
  21. A new beta update is available for subscribers. What's new? Lighting Point and spot lights are now supported in the new Vulkan renderer, with either PBR or Blinn-Phong lighting. Lighting is controlled by the shader in the material file. There are two main shaders you can use, "Shaders/PBR.spv" and "Shaders/Blinn-Phong.spv". See below for more details. JSON Materials Materials can now be loaded from JSON files. I am currently using the .json file extension instead of "mat", "mtl", or something else. If you load a scene and a JSON file is available with the same name as a material in that scene, the material will be loaded from a JSON file instead of the Leadwerks 4 .mat files. For example, you can create a JSON file named "brick01.json", place it in the same folder as "brick01.mat" and the new engine will load the JSON material if the brick material is used in a scene. However, it is not necessary to do this as the engine can also load Leadwerks 4 material files. A Turbo JSON material file looks like this. The string tokens are more or less locked in now and it is safe to start using them. { "turboMaterialDef": { "color": [ 1, 1, 1, 1 ], "emission": [ 0, 0, 0 ], "metallic": 0, "roughness": 0.6, "doubleSided": false, "blend": false, "albedoMap": "./concrete_clean_diff.tex", "normalMap": "./concrete_clean_dot3.tex", "metallicRoughnessMap": "", "emissionMap": "", "baseShader": "Shaders/PBR.spv", "shadowShader": "Shaders/Shadow.spv", "depthShader": "Shaders/DepthPass.spv" } } You can also indicate a shader for the new engine to use in an old Leadwerks 4 material file by adding a text line like this to the .mat file: baseshader="Shaders/myshader.spv" You do not need to specify a shader unless you are using a custom shader. JSON material files, by default, will use the PBR shader. Leadwerks 4 material files, by default, will use the Blinn-Phong shader. BC5 / BC7 Texture Compression A ton of new compression formats have been added, including the BC7 and BC5 formats, which provide better quality than DXT compression. Visual Studio 2019 actually has some good built-in DDS tools, although the BC7 compressor Is very slow. A sample material is provided using DDS textures (see "Materials/Rough-rockface1.json"). Lua Commands A set of simple global Lua commands has been added. template<typename T> void LuaSetGlobal(const std::string& name, T var) template<typename T> void LuaPushObject(const std::string& name, T var) template<typename T> T LuaToObject(const int index = -1) int LuaCollectGarbage(const int what = LUA_GCCOLLECT, const int data = 0); void LuaPushString(const std::string& s); void LuaPushNumber(const double n); void LuaPushBoolean(const bool b); void LuaPushNil(); void LuaPushValue(const int index = -1); bool LuaIsTable(const int index = -1); bool LuaIsNumber(const int index = -1); bool LuaIsString(const int index = -1); bool LuaIsBoolean(const int index = -1); bool LuaIsObject(const int index = -1); bool LuaIsNil(const int index = -1); bool LuaIsFunction(const int index = -1); bool LuaToBoolean(const int index = -1); std::string LuaToString(const int index = -1); double LuaToNumber(const int index = -1); int LuaType(const int index = -1); int LuaGetField(const std::string& name, const int index = -1); int LuaGetTable(const std::string& name, const int index = -1); int LuaGetGlobal(const std::string& name); void LuaSetField(const std::string& name, const int index = -1); void LuaSetTable(const int index = -1); void LuaPop(const int levels = 1); void LuaRemove(const int index = -1); void LuaSetStackSize(const int sz); int LuaGetStackSize(); void LuaNewTable(); This makes our code simpler and more readable: #include "Turbo.h" using namespace Turbo; int main(int argc, const char *argv[]) { //Create a window auto window = CreateWindow("MyGame", 0, 0, 1280, 720); //Create a rendering context auto context = CreateContext(window); //Set some variables in the script environment LuaSetGlobal("mainwindow", window); LuaSetGlobal("maincontext", context); //Create the world auto world = CreateWorld(); //Load a scene auto scene = LoadScene(world, "Maps/start.map"); //Show off a PBR material auto sphere = CreateSphere(world); auto mtl = LoadMaterial("Materials/Rough-rockface1.json"); sphere->SetMaterial(mtl); sphere->Move(0, 1, 0); sphere->SetScale(2); while (window->KeyHit(KEY_ESCAPE) == false and window->Closed() == false) { world->Update(); world->Render(context); } return 0; } You can gain access to the beta and support development by subscribing for just $5.
  22. This does tie into something I am working with right now and I would like your feedback. I am downloading some PBR materials across the web and there doesn't seem to be any real standard. It's much more efficient to pack metallic / roughness / occlusion into a single texture, but it seems like most people make these separate greyscale image files. GLTF files specify that metal / roughness should be in a single texture, but even there occlusion is sometimes added and sometimes not. What do you usually do? Is there any packed standard or common tools to handle this? Do you really mess around dragging and connecting lines between color channels for every single material you create? Doesn't that take ages to do?
  23. I now have point and spot lights working (without shadows) in the Vulkan renderer. Here are the results, with both "Physically-based rendering" (PBR) and Blinn-Phong shaders: Without the IBL contribution it's not terribly impressive, but this is progress.
  24. Ah, if you already have it working that is another matter.
  • Create New...