Jump to content

SpiderPig

Members
  • Posts

    2,423
  • Joined

  • Last visited

Everything posted by SpiderPig

  1. Thought I'd change this post to track the work in progress of my game instead. I've been spending time on procedural foliage generation. I create a volume and then add different items to that volume. It then procedurally places them inside the volume based on growth rates, shadow and collision radius and eventually height map data. The green bounding box is the foliage volume. The blue is where a sound will fade in when you enter it. The distance between the blue and green bounding boxes dictates the sound volume. I'll have to make a video of this soon. Each tree has an interaction assigned to it. This is a system I made in Leadwerks. The player has a box that it's bounds are used to get overlapping entities, if any of those entities have an interactable object assigned to it a label will appear on screen telling you what can be done. For these trees they will supply bark to your inventory. All the coloured shapes are debugging visualizers.
  2. I can do it in C++ but how to set it in the JSON material? { "material": { "version": 100, "color": [ 1.0, 1.0, 1.0, 1.0 ], "emission": [ 0.0, 0.0, 0.0 ], "metallic": 0.0, "roughness": 0.0, "transparent": false, "occlusionInfo": true, "occlusionScale": 1.0, "normalScale": 1.0, "shaderFamily": "PBR" } }
  3. Yeah and Ultra seems very capable of rendering multiple cameras.
  4. Yeah I agree, I'll use a 2nd camera. Thanks.
  5. Interesting. Is that a by-product of Vulkan or is it fixable down the track?
  6. I think what I need is to disable depth testing but it didn't do what I expected. The models that this material is applied to are small and are sometimes inside other objects, I just want them to be always onto of everything. debug_point_material = CreateMaterial(); debug_point_material->SetShaderFamily(LoadShaderFamily("Shaders\\Unlit.json")); debug_point_material->SetShadow(false); debug_point_material->SetDepthMask(false); debug_point_material->SetDepthTest(false);
  7. Yeah it is a tough one. I think I've found a way in Audacity to normalise sounds to a specific dB rating. Even if it's not exact it doesn't matter, just as long as the sounds have the right volume compared to each other. A few of the systems like dialogue, music and effects will have a master volume. I think I'll have to use a chart like this, just to get an idea on where things should be to make them at least a little realistic. I'll probably make my own chart based on this and insert my sounds at the correct dB rating and then just test it! See if that works.
  8. I assume most of you, like me, have various sounds gathered over the years but all of them are at varying levels of volume. Even simple things like, the footsteps on stone might be 10x louder than the footsteps for grass. I wonder if anyone knows if there is a standard volume sounds should be converted to in dB? I mean there are sounds which should be louder than others like explosions vs footsteps but are there pre-defined levels they should be at or is it just a guessing game? Curious to hear any thoughts you guys might have.
  9. Title says it all. I want to check what sound is assigned to a particular speaker.
  10. The bufferViews in the .gltf part have an extra parameter called "target", so maybe the bin data is different too?
  11. I didn't I loaded it straight into my project. I also compared it to other similar files that work and it seemed to be the same. Hard to tell really.
  12. I can't figure this one out. I was playing around with exporting from Blender and it displays on screen but only shows 1 LOD and no meshes for that LOD. It's worth mentioning it has no materials or images, not sure why that'd make a difference though. EDIT : It might be the newer GLTF export in blender. The files that work are with "Khronos glTF Blender I/O v1.4.40" and the ones I've uploaded that don't work are "Khronos glTF Blender I/O v3.6.27". #include "UltraEngine.h" #include "Components/Mover.hpp" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); camera->SetPosition(0, 5, -8); //Create a light auto light = CreateBoxLight(world); light->SetRotation(35, 45, 0); light->SetRange(-10, 10); auto model = LoadModel(world, "Models\\PineLarge_001.gltf"); //Only one LOD and no meshes. //Output says LOD_1 was loaded but then deleted int l = 0; for (auto lod : model->lods) { auto m = 0; for (auto mesh : lod->meshes) { Notify("lod : " + String(l) + ", mesh : " + String(m), ""); m++; } l++; } //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; } PineLarge.zip
  13. Here's a quick program and shader to test this out. The shader works with inTexCoords.xy but not with inTexCoords.zw. #include "UltraEngine.h" #include "Components/Mover.hpp" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); camera->SetPosition(0, 0, -3); //Create a light auto light = CreateBoxLight(world); light->SetRotation(35, 45, 0); light->SetRange(-10, 10); auto box = CreatePlane(world); box->SetRotation(-90.0f, 0.0f, 0.0f); auto material = LoadMaterial("Materials\\Test.mat"); box->SetMaterial(material); auto mesh = box->lods[0]->meshes[0]; mesh->SetVertexTexCoords(0, 0.0f, 0.0f, 1); mesh->SetVertexTexCoords(1, 1.0f, 0.0f, 1); mesh->SetVertexTexCoords(2, 0.0f, 1.0f, 1); mesh->SetVertexTexCoords(3, 1.0f, 1.0f, 1); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; } Shader : #version 450 #extension GL_GOOGLE_include_directive : enable #extension GL_ARB_separate_shader_objects : enable #extension GL_EXT_multiview : enable #include "../../../../../../../../UltraEngine/Templates/Common/Shaders/Base/TextureArrays.glsl" #include "../../../../../../../../UltraEngine/Templates/Common/Shaders/Base/Materials.glsl" layout(location = 5 ) in flat uint inMaterialIndex; layout(location = 2 ) in vec4 inTexCoords; layout(location = 0) out vec4 color[8]; void main() { color[0] = texture( texture2DSampler[ GetMaterialTextureHandle( materials[ inMaterialIndex ] , 0 ) ] , inTexCoords.zw ); } Files : Shaders.zip
  14. The larger the range between the camera's min and max view range, the less precision there is for things. 0.01 is good for most applications I think. Ultra will have double float support
  15. I used C++ in Leadwerks and used all the 2D drawing commands. It was slow but it worked.
  16. Similar to what I mentioned here for materials. If I can get the index of an entity I can store extra data in a texture per entity. Unless there's already a way to do this?
  17. I've been looking through every piece of shader code for some wiggle room but you've stripped everything down to the bare minimum number of bytes needed so there's no room left for me. But this is why Ultra is fast. I was thinking that too. I wanted to see if there were other ways first before I started on this. Thanks!
  18. I like the control over them myself. I think being able to set them would be good. In other words, I want to use them to store other values in a custom shader.
  19. Can we not set a vertex's tangent or bitangent in Ultra? I only found these in the Mesh class for vertices. virtual void SetVertexPosition(const uint32_t v, const Vec3& position); virtual void SetVertexNormal(const uint32_t v, const Vec3& normal); virtual void SetVertexTexCoords(const uint32_t v, const Vec2& texcoords, const int index = 0); virtual void SetVertexColor(const uint32_t v, const Vec4& color);
  20. Ohhh okay. Thanks, I'll try something else.
  21. I wonder if I can pass some custom floats per vertex to a fragment shader like this or does the extracting of the vertex colors in vert shader only work with values from 0.0f to 1.0f? mesh->SetVertexColor(0, (float)1200, (float)1400, (float)6450, (float)780);
  22. Thanks I'll take a look at this soon.
  23. Lua is good to learn with. Looking forward to seeing what you achieve!
  24. I found C++ in Leadwerks a lot faster than Lua. If your making a small game then Lua is fine and a lot quicker to get results. But if you want a large open world then C++ will be faster and give you more access to underlying commands in Leadwerks. It's C++ all the way for me. 😎
×
×
  • Create New...