Yue Posted September 21 Posted September 21 -- preset actual de MSAA self._msaaPreset = nil function self:UpdateMSAA(camera) local current = _cmbBoxMSAA:GetSelectedItem() -- 1=OFF, 2=2X, 3=4X, 4=8X if current == _msaaLast then return end _msaaLast = current -- Mapeo UI → muestras válidas para Camera:SetMsaa local map = { [1] = 0, -- OFF [2] = 2, -- 2X [3] = 4, -- 4X [4] = 8, -- 8X -- Si algún día agregas más: [5] = 16, [6] = 32, } local samples = map[current] or 0 camera:SetMsaa(samples) self._msaaPreset = current end SMAA does not make changes in real time, only when I restart the APP. Is it an error or is it an expected behavior? 1 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Josh Posted September 21 Posted September 21 Your code must have some error, because this code works correctly: local game = import("Utilities/Game.lua") if not game then return end local camera = CreateCamera(game.world) local box = CreateBox(game.world) box:Turn(0,0,34) box:Move(0,0,2) while true do if game.window:KeyDown(KEY_SPACE) then camera:SetMsaa(4) else camera:SetMsaa(1) end --Update the world game.world:Update() --Update Steamworks (optional) Steamworks.Update() --Garbage collection step collectgarbage() --Render the world to the framebuffer local vsync = true if istable(game.settings.video) and isboolean(game.settings.video.vsync) then vsync = game.settings.video.vsync end game.world:Render(game.framebuffer, vsync) end ::Exit:: game:SaveSettings() Steamworks.Shutdown() 1 Quote Let's build cool stuff and have fun.
Yue Posted September 21 Author Posted September 21 17 minutes ago, Josh said: Your code must have some error, because this code works correctly: local game = import("Utilities/Game.lua") if not game then return end local camera = CreateCamera(game.world) local box = CreateBox(game.world) box:Turn(0,0,34) box:Move(0,0,2) while true do if game.window:KeyDown(KEY_SPACE) then camera:SetMsaa(4) else camera:SetMsaa(1) end --Update the world game.world:Update() --Update Steamworks (optional) Steamworks.Update() --Garbage collection step collectgarbage() --Render the world to the framebuffer local vsync = true if istable(game.settings.video) and isboolean(game.settings.video.vsync) then vsync = game.settings.video.vsync end game.world:Render(game.framebuffer, vsync) end ::Exit:: game:SaveSettings() Steamworks.Shutdown() I see you're using 1. I thought the documentation said to start at 0, 2, 4, etc. Now I understand what's happening. I set it to 0 to disable it, and the effect remains stuck 1 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Solution Josh Posted September 21 Solution Posted September 21 Ah, I see. I am fixing it so that 0 also works. 2 Quote Let's build cool stuff and have fun.
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.