-
Posts
24,626 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Josh
-
How to save depth with object rendered with extra camera?
Josh replied to Dreikblack's topic in Programming
Place it behind the other objects, and use the renderlayer so it only appears in one camera. -
How to save depth with object rendered with extra camera?
Josh replied to Dreikblack's topic in Programming
You could also put a very large black plane in front of the camera to block to sky out, and make it only appear in the second camera. -
How to save depth with object rendered with extra camera?
Josh replied to Dreikblack's topic in Programming
I don't know. -
0.9.6 Some glTF animations will work better now in the model editor. I am looking for a tool to reset the bind poses. Bind poses are one of the stupidest "features" I have ever seen in any model format.
-
Does anyone have experience with node.js? I am interested in trying this tool on some glTF files: https://gltf-transform.dev/modules/functions/functions/flatten I have never worked with this before and learning for the first time seems like a big investment for something that probably won't work.
-
Your signature says 16 GB is that correct? This is caused by either not enough memory, or memory fragmentation. There's probably not much I can do about it.
-
0.9.6 Improved support for legacy MDL file format exported from Unwrap3D.
-
How to save depth with object rendered with extra camera?
Josh replied to Dreikblack's topic in Programming
Oh, I see. The fog is turning the sprite color black, and then that gets overlaid on top of the screen, right? I did not have any of these problems in my outline shader because I just used the depth buffer to decide whether the output should be white or black. But you are passing through the color buffer so that is more complicated. Maybe the only way is a per-camera setting to disable the skybox if it has been set. -
This means that malloc or realloc are returning NULL. How much RAM do you have?
-
This script can quickly model materials. Run it with the Scripts > Run menu item. Function is not recursive and the path to load is hard-coded, but that can be easily changed. Retarget Materials.lua
-
There are two Windows command that do this. With those you can get anything you want. WCHAR szPath[MAX_PATH]; if (SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_COMMON_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, szPath))) { return WString(szPath).Replace("\\", "/"); } PIDLIST_ABSOLUTE pidlist; wchar_t path[MAX_PATH]; SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidlist); SHGetPathFromIDListW(pidlist, path); return WString(path).Replace("\\", "/");;
-
How to save depth with object rendered with extra camera?
Josh replied to Dreikblack's topic in Programming
You could use camera fog: camera->SetFogColor(0,0,0,1); camera->SetFogAngle(90,91); auto range = camera->GetRange().y; camera->SetFogRange(range * 0.98, range * 0.99); -
0.9.6 Fixed highlighting in the model editor, so if a mesh is selected, it will be highlighted, and if a material is selected, all meshes that use that material will be highlighted. Very useful when you are assigning materials and modifying models.
-
How to save depth with object rendered with extra camera?
Josh replied to Dreikblack's topic in Programming
I think that is a question for another day. -
0.9.6 Entity properties editor will now be locked if a prefab is selected. Prefab subobjects can no longer be deleted from the scene. The top-level prefab must be deleted. Prefab subobjects can no longer be moved around in the scene hierarchy tree. Only the top-most prefab entity can be moved.
-
How to save depth with object rendered with extra camera?
Josh replied to Dreikblack's topic in Programming
Also, you don't need two orthographic cameras. Just place one sprite a little bit closer to the camera to make it appear on top. -
How to save depth with object rendered with extra camera?
Josh replied to Dreikblack's topic in Programming
Is this what you are trying to do? #include "UltraEngine.h" #include "ComponentSystem.h" 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(); auto framebuffer = CreateFramebuffer(window); auto sz = framebuffer->GetSize(); int MAIN_LAYER = 1, OUTPUT_LAYER = 2, EXTRA_LAYER = 4, EXTRA_OUTPUT_LAYER = 8; auto light = CreateBoxLight(world); light->SetRotation(35, 45, 0); light->SetRange(-10, 10); auto backBox = CreateBox(world, 5); backBox->SetPosition(0, 0, 7); backBox->SetColor(0, 1, 0, 1); auto betweenBox = CreateBox(world); betweenBox->SetRenderLayers(EXTRA_LAYER); betweenBox->SetColor(1, 0, 0, 1); auto unlitShader = LoadShaderFamily("Shaders/Unlit.fam"); auto boxMat = CreateMaterial(); boxMat->SetShaderFamily(unlitShader); betweenBox->SetMaterial(boxMat); auto frontBox = CreateBox(world, 1); frontBox->SetPosition(-0.5, 0, -0.5); frontBox->SetColor(1, 1, 0, 1); auto mainCameraInput = CreateCamera(world); mainCameraInput->SetPosition(0, 0, -3); mainCameraInput->SetRenderLayers(MAIN_LAYER); auto mainTextureBuffer = CreateTextureBuffer(sz.x, sz.y); mainCameraInput->SetRenderTarget(mainTextureBuffer); auto mainSprite = CreateSprite(world, sz.x, sz.y); mainSprite->SetRenderLayers(OUTPUT_LAYER); auto mainMaterial = CreateMaterial(); mainSprite->SetMaterial(mainMaterial); mainMaterial->SetTexture(mainTextureBuffer->GetColorAttachment()); //red transporent box render part auto extraCameraInput = CreateCamera(world); extraCameraInput->SetPosition(0, 0, -3); extraCameraInput->SetRenderLayers(EXTRA_LAYER); extraCameraInput->SetMatrix(mainCameraInput->matrix); extraCameraInput->SetLighting(false); extraCameraInput->SetClearMode(CLEAR_COLOR); auto extraTextureBuffer = CreateTextureBuffer(sz.x, sz.y); extraTextureBuffer->SetDepthAttachment(mainTextureBuffer->GetDepthAttachment()); extraCameraInput->SetRenderTarget(extraTextureBuffer); auto extraSprite = CreateSprite(world, sz.x, sz.y); extraSprite->SetRenderLayers(EXTRA_OUTPUT_LAYER); auto extraMaterial = CreateMaterial(); extraSprite->SetMaterial(extraMaterial); extraMaterial->SetTransparent(true); extraMaterial->SetTexture(extraTextureBuffer->GetColorAttachment()); extraMaterial->SetColor(1, 1, 1, 0.5); auto mainCameraOutput = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); mainCameraOutput->SetPosition(sz.x * 0.5f, sz.y * 0.5f, 0); mainCameraOutput->SetRenderLayers(OUTPUT_LAYER); mainCameraOutput->SetLighting(false); auto extraCameraOutput = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); extraCameraOutput->SetPosition(sz.x * 0.5f, sz.y * 0.5f, 0); extraCameraOutput->SetRenderLayers(EXTRA_OUTPUT_LAYER); extraCameraOutput->SetClearMode(CLEAR_DEPTH); extraTextureBuffer->SetDepthAttachment(mainTextureBuffer->GetDepthAttachment()); //extraCameraOutput->SetOrder(2); extraCameraOutput->SetLighting(false); //extraCameraOutput->SetHidden(true); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; } -
I was able to recover this just by adding some extra checks to make the the stored values are the correct type. This will work in the next build that goes up.
-
-
-
How to save depth with object rendered with extra camera?
Josh replied to Dreikblack's topic in Programming
I think you would have to create another camera in between "camera" and cam2 with the same characteristics as "camera" but rendering to the texture buffer. That would draw the depth information, then cam2 would render the transparent objects on that, and retain the depth info to discard fragments. It would be better if "camera" was rendering to a texture buffer, you could get the depth attachment, and attach that to the texture buffer cam2 is using. Then when cam2 starts drawing, it already has the depth info from the main camera. -
Can't move camera in editor viewport
Josh replied to Haydenmango's topic in Leadwerks Engine Bug Reports
Do you have a high precision mouse? -
0.9.6 Full build performed with all recent fixes.