Dreikblack Posted May 31, 2024 Posted May 31, 2024 cam2:SetUniform(1, "Thickness", 4); -- Get the displays local displays = GetDisplays() -- Create a window local window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[1], WINDOW_CENTER | WINDOW_TITLEBAR) -- Create a world local world = CreateWorld() -- Create a framebuffer local framebuffer = CreateFramebuffer(window) -- Create a camera local camera = CreateCamera(world) camera:SetClearColor(0.125) camera:SetPosition(0, 0, -2) -- Create a light local light = CreateBoxLight(world) light:SetRotation(45, 35, 0) light:SetRange(-10, 10) light:SetColor(2) -- Create a model local model = CreateBox(world) model:SetColor(0, 0, 1) model:SetRenderLayers(1 + 2) local cam2 = CreateCamera(world); cam2:SetClearColor(0, 0, 0, 0); cam2:SetRenderLayers(2); cam2:SetFov(camera:GetFov()); cam2:SetMatrix(camera:GetMatrix()); cam2:AddPostEffect(LoadPostEffect("Shaders/Outline.fx")); cam2:SetUniform(1, "Thickness", 4); -- ERROR HERE local sz = framebuffer:GetSize(); local texbuffer = CreateTextureBuffer(sz.x, sz.y); cam2:SetRenderTarget(texbuffer); -- Display overlay local sprite = CreateSprite(world, sz.x, sz.y); local color = Vec4(0, 1, 0, 1); sprite:SetColor(color); sprite:SetRenderLayers(4); local mtl = CreateMaterial(); sprite:SetMaterial(mtl); mtl:SetTransparent(true); mtl:SetTexture(texbuffer:GetColorAttachment()); local cam3 = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); cam3:SetClearMode(CLEAR_DEPTH); cam3:SetRenderLayers(4); cam3:SetPosition(sz.x * 0.5, sz.y * 0.5, 0); -- Main loop while not window:Closed() and not window:KeyDown(KEY_ESCAPE) do model:Turn(0, 1, 0) world:Update() world:Render(framebuffer) end Quote
Josh Posted June 1, 2024 Posted June 1, 2024 Fixed! 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Dreikblack Posted June 15, 2024 Author Posted June 15, 2024 I have error "vector subscript out of range" now with SetUniform (Steam, beta branch) Quote
Solution Josh Posted June 22, 2024 Solution Posted June 22, 2024 Fixed. I also made it a little more lenient so that Lua can set integer uniforms. Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.