klepto2 Posted December 2, 2022 Share Posted December 2, 2022 While Start and Update are verbs, they also have a different meaning than Collide. Maybe some guideline would help: If something is definitely called every time (like Start or Update) use the verb. If something is called on a specific condition it should (in my opinion) called something like: On... e.g: OnCollision The problem with the collide(...) in this context is that it could be misintrepted as it actually is the reaction of a Collision and does not actually does the Collision. 1 1 Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
reepblue Posted December 2, 2022 Share Posted December 2, 2022 Also, where is the parameter for the hit material to make distinct impact effects and sounds? Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted December 2, 2022 Author Share Posted December 2, 2022 There currently is not one. I found that the player collision was far better when I load a map and maintain brushes as separate objects, each using a convex hull collider. Like, a lot better, it avoids some ugly glitches. But that doesn't keep track of separate faces, so there's no separate materials. There is probably a way to figure out the closest face to the hit point. I also plan to migrate over to Newton 4 gradually, but we don't know yet how or if the situation will be any different Since it is undetermined I am leaving it out for now. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted December 2, 2022 Author Share Posted December 2, 2022 Updates the shaders so the shader families no longer have any missing modules. 2 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
SpiderPig Posted December 2, 2022 Share Posted December 2, 2022 Error: Failed to load shader module "Shaders/Downsample.frag.spv" Most of the loading errors are gone - just have this one still. 1 Link to comment Share on other sites More sharing options...
klepto2 Posted December 3, 2022 Share Posted December 3, 2022 a small experiment with the refraction shader and some modifications to get animated textures to work: you can see, that the water is blending nicely with the terrain. The normal map is the animated 3d texture Josh created in his blog. Unfortunatly the normal isn't stored currently in the refraction inputs, but this should be no problem later. The blending is calculated by actual thickness of the volume and could be (in theory) modified by some kind of visibility parameter or, maybe the alpha value or something like this. 4 Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
SpiderPig Posted December 3, 2022 Share Posted December 3, 2022 That's looks good. Is this an infinite water plane or will it work with any custom shape? @Josh A lots changed since I've last compiled a custom shader - is this still possible? I get a few errors currently, I see Base.frag is now base_frag.glsl but I'm not sure if I should be suing that anymore... Link to comment Share on other sites More sharing options...
Josh Posted December 3, 2022 Author Share Posted December 3, 2022 3 minutes ago, SpiderPig said: That's looks good. Is this an infinite water plane or will it work with any custom shape? @Josh A lots changed since I've last compiled a custom shader - is this still possible? I get a few errors currently, I see Base.frag is now base_frag.glsl but I'm not sure if I should be suing that anymore... My plan for this is to use a visual node editor that autogenerates a shader family from a template. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
klepto2 Posted December 3, 2022 Share Posted December 3, 2022 1 minute ago, SpiderPig said: That's looks good. Is this an infinite water plane or will it work with any custom shape? @Josh A lots changed since I've last compiled a custom shader - is this still possible? I get a few errors currently, I see Base.frag is now base_frag.glsl but I'm not sure if I should be suing that anymore... This is currently just a plane generated with CreatePlane and some customizations made to the PBR and rafraction shaders to restore some functionality Josh has currently disabled (animated textures, texture scaling). It is more or less a test how easy it is to get properly refracted materials in the engine. In Leadwerks you have to create your own renderer for custom water (if not deffered) you need to get a rrefraction and reflection texture. But in UltraEngine this works out of the box (nearly). 1 Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
klepto2 Posted December 3, 2022 Share Posted December 3, 2022 got the normalmap in the refraction pass working and added a simple extinction formular for the depth transition: 5 Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
SpiderPig Posted December 3, 2022 Share Posted December 3, 2022 Looks amazing now, good job 🙂 Link to comment Share on other sites More sharing options...
klepto2 Posted December 3, 2022 Share Posted December 3, 2022 Hi Josh. As shown above i use your generated water1.dds. And as you can see the dds works, but is generated wrong (only miplevel 0 is animating). As it is a volume texture the z component is of constant size and must not be divided for the mipmapchain as the chain should always have 128 slices for each miplevel. int framecount = 128; std::vector<shared_ptr<Pixmap> > pixmaps(framecount); for (int n = 0; n < framecount; ++n) { pixmaps[n] = LoadPixmap("Materials/Animations/water1_" + String(n) + ".png"); } //Build mipmaps iVec3 size = iVec3(pixmaps[0]->size.x, pixmaps[0]->size.y, pixmaps.size()); auto mipchain = pixmaps; while (true) { auto osize = size; size.x = Max(1, size.x / 2); size.y = Max(1, size.y / 2); size.z = Max(1, size.z); for (int n = 0; n < size.z - 1; ++n) { Print(n); auto a = pixmaps[n + 0]; auto b = pixmaps[n + 1]; auto mipmap = CreatePixmap(osize.x, osize.y, pixmaps[0]->format); for (int x = 0; x < osize.x; x++) { for (int y = 0; y < osize.y; y++) { int rgba0 = a->ReadPixel(x, y); int rgba1 = b->ReadPixel(x, y); int rgba = RGBA((Red(rgba0) + Red(rgba1)) / 2, (Green(rgba0) + Green(rgba1)) / 2, (Blue(rgba0) + Blue(rgba1)) / 2, (Alpha(rgba0) + Alpha(rgba1)) / 2); mipmap->WritePixel(x, y, rgba); } } mipmap = mipmap->Resize(size.x, size.y); pixmaps[n] = mipmap; mipchain.push_back(mipmap); } if (size.x == 1 && size.y == 1) break; } SaveTexture("water2.dds", TEXTURE_3D, mipchain, framecount); This should work correctly, but the SaveTexture is now complaing about wrong miplevel count. Saving texture "water2.dds" Error: Incorrect numbers of images in mipchain I assume this is because the z component is wrong calculated in the SaveTexture - Validation. Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
SpiderPig Posted December 4, 2022 Share Posted December 4, 2022 Not sure if this a bug, if I set a material to a model and then add a mesh to that model, the material is not assigned to the new mesh. You have to re-apply the material. Should it be so? I don't know... Link to comment Share on other sites More sharing options...
Josh Posted December 4, 2022 Author Share Posted December 4, 2022 1 hour ago, SpiderPig said: Not sure if this a bug, if I set a material to a model and then add a mesh to that model, the material is not assigned to the new mesh. You have to re-apply the material. Should it be so? I don't know... This behavior is correct. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted December 4, 2022 Author Share Posted December 4, 2022 Update Stream::EoF() is now Stream::Eof() Window::HideMouse / ShowMouse removed, use Window::SetCursor with CURSOR_NULL instead TextureBuffer example now working. Do not run this until you update the SDK, the previous build will crash your graphics driver Lots of small API adjustments and work on the documentation 2 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted December 4, 2022 Author Share Posted December 4, 2022 Update Tessellation fixed: https://www.ultraengine.com/learn/Camera_SetTessellation All acronym capitalization changed to whatever this is called: Camera::SetFOV is now SetFov. AABB is now Aabb. RGBA() is Rgba() Camera::SetRealtime works now: https://www.ultraengine.com/learn/Camera_SetRealtime Some model creation functions are changed to specify the mesh primitive type. Lines are not yet supported, but this was done in anticipation of future support: https://www.ultraengine.com/learn/CreateBox 3 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted December 4, 2022 Author Share Posted December 4, 2022 On 12/3/2022 at 4:09 PM, klepto2 said: This should work correctly, but the SaveTexture is now complaing about wrong miplevel count. Saving texture "water2.dds" Error: Incorrect numbers of images in mipchain I assume this is because the z component is wrong calculated in the SaveTexture - Validation. Wait...wouldn't the Z axis be half as big each mipmap? #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto plg = LoadPlugin("Plugins/FITextureLoader"); int framecount = 128; std::vector<shared_ptr<Pixmap> > pixmaps(framecount); for (int n = 0; n < framecount; ++n) { pixmaps[n] = LoadPixmap("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Animations/water1_" + String(n) + ".png"); } //Build mipmaps iVec3 size = iVec3(pixmaps[0]->size.x, pixmaps[0]->size.y, pixmaps.size()); auto mipchain = pixmaps; while (true) { auto osize = size; size.x = Max(1, size.x / 2); size.y = Max(1, size.y / 2); size.z = Max(1, size.z / 2); for (int n = 0; n < size.z; ++n) { auto a = pixmaps[n * 2 + 0]; auto b = pixmaps[n * 2 + 1]; auto mipmap = CreatePixmap(osize.x, osize.x, pixmaps[0]->format); for (int x = 0; x < pixmaps[0]->size.x; ++x) { for (int y = 0; y < pixmaps[0]->size.y; ++y) { int rgba0 = a->ReadPixel(x, y); int rgba1 = b->ReadPixel(x, y); int rgba = Rgba((Red(rgba0) + Red(rgba1)) / 2, (Green(rgba0) + Green(rgba1)) / 2, (Blue(rgba0) + Blue(rgba1)) / 2, (Alpha(rgba0) + Alpha(rgba1)) / 2); mipmap->WritePixel(x, y, rgba); } } mipmap = mipmap->Resize(size.x, size.y); pixmaps[n] = mipmap; mipchain.push_back(mipmap); } if (size == iVec3(1, 1, 1)) break; } //Convert to compressed format for (int n = 0; n < mipchain.size(); ++n) { mipchain[n] = mipchain[n]->Convert(TEXTURE_BC5); } //Save SaveTexture(GetPath(PATH_DESKTOP) + "/water1.dds", TEXTURE_3D, mipchain, framecount); return 0; } My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
IceBurger Posted December 4, 2022 Share Posted December 4, 2022 32 minutes ago, Josh said: All acronym capitalization changed to camelcase: Camera::SetFOV is now SetFov. AABB is now Aabb. RGBA() is Rgba() The "readable aesthetic" and "grammar nazi" sides of my brain are fighting over the value of this particular change 😅 Thanks for the hard work you've put into this so far. 1 i now hate love C++ Beeeeeeeeeeeeeep~~This is a test of the emergency signature system~~Beeeeeeeeeeeeeep RX 6800XT | i5-13600KF | 32GB DDR5 | 1440p is perfect Link to comment Share on other sites More sharing options...
Josh Posted December 4, 2022 Author Share Posted December 4, 2022 @IceBurgerThe Lod class is what initiated this. After that I just started making everything consistent and I like it better. https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ms229043(v=vs.100)?redirectedfrom=MSDN 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
SpiderPig Posted December 4, 2022 Share Posted December 4, 2022 This is going to be hard to pin point but randomly every few launches in debug mode it will crash with this error... Stopping and restarting the debug session and it will then work. No idea how to solve it but thought it worth mentioning at least. Link to comment Share on other sites More sharing options...
Josh Posted December 4, 2022 Author Share Posted December 4, 2022 It's crashing on one of the instructions the rendering command buffer executes, so it could be anything. Please send me code to produce the problem. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
SpiderPig Posted December 5, 2022 Share Posted December 5, 2022 The project is pretty big and it only happens like 1 in 20 times, I think even if I sent you the whole project you'd be trying for ages to actually make it happen. Link to comment Share on other sites More sharing options...
reepblue Posted December 5, 2022 Share Posted December 5, 2022 I just updated my project, and it just copied the $PROJECTNAME.vcxproj file without renaming and overriding the old project. I had to redo my fix for my preprocessor and I ended up just deleting everything regarding the components for it to compile again. I know project files will probably not change much after the release, but I also had to redefine my external libraries. I would suggest a dedicated directory for external libraries, that all projects have included but that could cause some issues. Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
SpiderPig Posted December 5, 2022 Share Posted December 5, 2022 Is the Basis plugin meant to be missing? Link to comment Share on other sites More sharing options...
klepto2 Posted December 5, 2022 Share Posted December 5, 2022 9 hours ago, Josh said: Wait...wouldn't the Z axis be half as big each mipmap? #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto plg = LoadPlugin("Plugins/FITextureLoader"); int framecount = 128; std::vector<shared_ptr<Pixmap> > pixmaps(framecount); for (int n = 0; n < framecount; ++n) { pixmaps[n] = LoadPixmap("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Animations/water1_" + String(n) + ".png"); } //Build mipmaps iVec3 size = iVec3(pixmaps[0]->size.x, pixmaps[0]->size.y, pixmaps.size()); auto mipchain = pixmaps; while (true) { auto osize = size; size.x = Max(1, size.x / 2); size.y = Max(1, size.y / 2); size.z = Max(1, size.z / 2); for (int n = 0; n < size.z; ++n) { auto a = pixmaps[n * 2 + 0]; auto b = pixmaps[n * 2 + 1]; auto mipmap = CreatePixmap(osize.x, osize.x, pixmaps[0]->format); for (int x = 0; x < pixmaps[0]->size.x; ++x) { for (int y = 0; y < pixmaps[0]->size.y; ++y) { int rgba0 = a->ReadPixel(x, y); int rgba1 = b->ReadPixel(x, y); int rgba = Rgba((Red(rgba0) + Red(rgba1)) / 2, (Green(rgba0) + Green(rgba1)) / 2, (Blue(rgba0) + Blue(rgba1)) / 2, (Alpha(rgba0) + Alpha(rgba1)) / 2); mipmap->WritePixel(x, y, rgba); } } mipmap = mipmap->Resize(size.x, size.y); pixmaps[n] = mipmap; mipchain.push_back(mipmap); } if (size == iVec3(1, 1, 1)) break; } //Convert to compressed format for (int n = 0; n < mipchain.size(); ++n) { mipchain[n] = mipchain[n]->Convert(TEXTURE_BC5); } //Save SaveTexture(GetPath(PATH_DESKTOP) + "/water1.dds", TEXTURE_3D, mipchain, framecount); return 0; } Of course, you are right. Then there must be another error in it. Because everything is not animated with miplevel > 0. I take another look at it. Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
Recommended Posts