PNG materials?

local splash = Material("gmachines/splash.png")

function ENT:Draw()
		render.MaterialOverrideByIndex(1, splash)

What am I doing wrong?

What you are doing wrong is not using vertexlitgeneric shader, which is required for models.

[editline]12th October 2014[/editline]

PNGs default to unlitgeneric.

That didn’t work either.

[editline]12th October 2014[/editline]

On a related note, how can I precache materials?

What didn’t work? You’ll have to make a new material using CreateMaterial() for this as far as I can tell.

Try this
local splash = Material(“gmachines/splash.png”,“vertextlitgeneric alphatest”)

He can’t use the PNG parameters in the Material function to make this possible?


Nope, still invisible.