High quality images

I’ve tried everything: SetMaterial, SetTexture, DImage, etc.

No matter what, the textures that come up on my GUI is always very bad quality if a player has their “Texture quality” setting on medium or low. I find that in things like the spawn menu, or ItemForge, textures are used fine without any compression, always top quality.

My VMT looks like this, same as ItemForge has it. I’ve also tried using exactly the Silkicon VMTs (with basetexture changed of course)



"UnlitGeneric"
{
	"$basetexture" "gui/silkicons/server"
	"$vertexalpha" 1
	"$vertexcolor" 1
	"$nolod" 1
}


Does anybody have any idea why my images just aren’t coming up full quality? I know it’s not the images themselves because when my texture quality is set on “Very High” they look pretty nice. If my texture quality is on “low”, however, they look like crap while itemforge and spawnmenu looks fine.

This is from ItemForge:
[lua]
function PANEL:Paint()
local x=self.IconX;
local y=self.IconY;

surface.SetDrawColor(255,255,255,255);
if self.Held && self.MouseOver then
	--Nudge icon a little bit if held
	x=x+1;
	y=y+1;
	
	surface.SetMaterial(self.PressedMat);
	surface.DrawTexturedRect(0,0,self:GetWide(),self:GetTall());
else
	surface.SetMaterial(self.ReleasedMat);
	surface.DrawTexturedRect(0,0,self:GetWide(),self:GetTall());
end
	
if self.Icon then
	surface.SetMaterial(self.Icon);
	surface.DrawTexturedRect(x,y,self:GetWide(),self:GetTall());
end

return true;

end
[/lua]

To clarify what I’ve tried:
Using a standard DImage:
[lua]
hook.Add(“InitPostEntity”, “igb_drawServer”, function()
local server = vgui.Create(“DImage”)
server:SetImage(“gui/silkicons/server”)
–server:SetImage(“gui/silkicons/arrow_refresh”)
server:SetSize(16,16)
server:SetPos(5,2)
end)
[/lua]

Using SetMaterial:
[lua]
function iGB.Draw()

--local tex = surface.GetTextureID("gui/silkicons/server")
local tex = Material("gui/silkicons/server")
surface.SetMaterial(tex)
surface.SetDrawColor(255,255,255,255)
surface.DrawTexturedRect(5, 2, 16, 16)

    -- stuff

end
hook.Add(“HUDPaint”, “infGlobalBarHook”, iGB.Draw)

[/lua]

And using SetTexture… All to the same result.

-snip- I’m an idiot

Thank you tons, but is there any way I can use VTFEdit to batch edit all my silk icons to fix the nomip nolod >_>

Wait what… My original images VTFs didn’t have the nomip nolod… And I will now fix

I think my problem is as Azu pointed out.

Oh lol I thought I didn’t read your post right, but I guess I did :stuck_out_tongue:

I thought the problem would be you didn’t check No level of detail for the .vtf

Try to make the texture look bigger.

That was the problem.

So you checked “No mipmap” and “No Level of Detail” in VTFEdit right?

http://img23.imageshack.us/img23/3076/vtfqualityexample2.jpg

http://img23.imageshack.us/img23/1064/vtfqualityexample.jpg



"UnlitGeneric"
{
	"$basetexture" "path/to/texture"
	"$vertexalpha" 1
	"$vertexcolor" 1
	"$nolod" 1

}


Do those settings exactly and you’ll have the highest quality VTF no matter what setting of Texture Quality the client has.