Jump to content

Loosing quality through DrawImage?


SpiderPig
 Share

Recommended Posts

Hello. I've taken a close look at my 2D images when they are drawn with DrawImage() and there is a notable quality loss. Not sure if this is a bug in the conversion process or not or if it's my textures... So I've attached the images to see what you all think. One is the original image rendered in Blender. And the other two are screen shots in game; one with the filter mode set to pixel and the other to smooth. Thanks smile.png

Data.zip

Link to comment
Share on other sites

I put together a quick little app to test it and get the same results. Here's the code;

--This function will be called once when the program starts
tex=nil
function App:Start()

--Initialize Steamworks (optional)
Steamworks:Initialize()

--Set the application title
self.title="MyGame"

--Create a window
self.window=Window:Create(self.title)
self.window:HideMouse()

--Create the graphics context
self.context=Context:Create(self.window,0)
if self.context==nil then return false end

--Create a world
self.world=World:Create()

--Load a map
local mapfile = System:GetProperty("map","Maps/start.map")
if Map:Load(mapfile)==false then return false end
tex=Texture:Load("Origanal.tex")

return true
end
--This is our main program loop and will be called continuously until the program ends
function App:Loop()

--If window has been closed, end the program
if self.window:Closed() or self.window:KeyDown(Key.Escape) then return false end

--Update the app timing
Time:Update()

--Update the world
self.world:Update()

--Render the world
self.world:Render()

--Render statistics
self.context:SetBlendMode(Blend.Alpha)
if DEBUG then
 self.context:SetColor(1,0,0,1)
 self.context:DrawText("Debug Mode",2,2)
 self.context:SetColor(1,1,1,1)
 self.context:DrawStats(2,22)
 self.context:SetBlendMode(Blend.Solid)
else
 --Toggle statistics on and off
 if (self.window:KeyHit(Key.F11)) then self.showstats = not self.showstats end
 if self.showstats then
  self.context:SetColor(1,1,1,1)
  self.context:DrawText("FPS: "..Math:Round(Time:UPS()),2,2)
 end
end
self.context:DrawImage(tex,200,200)

--Refresh the screen
self.context:Sync(false)

--Returning true tells the main program to keep looping
return true
end

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...