Drawing sprites properly

Here’s my latest problem, I want to draw a sprite but it shows up in a black box. What am I doing wrong?
[lua]local pos,material,color = Vector(0,0,0), Material( “sprites/blueglow1” ),Color(255,255,255,255)
hook.Add( “HUDPaint”, “paintsprites”, function()
cam.Start3D(EyePos(),EyeAngles())
render.SetMaterial( material )
render.DrawSprite( pos, 16, 16, color)
cam.End3D()
end )
[/lua]

edit : Rate me boxes, because that’s what sprites/blueglow2 doesn’t have.

Ah, that issue… yeah it’s annoying. That’s the only way I found to solve it, it’s probably not the best one, but it works. You have to create a new material using that texture, and add the “$additive” property to it.

[lua]local GlowSprite = CreateMaterial(“some_random_unique_name”,“UnlitGeneric”,{
["$basetexture"] = “sprites/blueglow1”,
["$nocull"] = 1,
["$additive"] = 1,
["$vertexalpha"] = 1,
["$vertexcolor"] = 1,
})[/lua]

And then:

[lua]local pos,material,color = Vector(0,0,0), GlowSprite,Color(255,255,255,255)
hook.Add( “HUDPaint”, “paintsprites”, function()
cam.Start3D(EyePos(),EyeAngles())
render.SetMaterial( material )
render.DrawSprite( pos, 16, 16, color)
cam.End3D()
end )
[/lua]

Alright, thanks for the tip! Lucky for me it was already done in this case with blueglow2