Png from HTML to Material

I saw that it’s possible save png files now. Is it possible to create a material with the png this way yet?

I think, its

local mat = Material('data/yoursavedmaterialname.png')

Oh cool. I didn’t expect that to work since I thought the path was relative to the materials directory. Thanks.

It works, but I’m getting a big lag when I do this with those appearing in the console.

RELOAD [data\]
"materials/concrete/concreteafloor009a.vtf": can't be found on disk
"materials/detail/detail_noise1.vtf": can't be found on disk

There must be a better way.

This is my code
local filename = name…".png"
http.Fetch(“myurl/”…filename, function(body)
local mat = Material(“data/”…filename, “unlitgeneric”)

well for a start, it doesn’t look like you’re saving the webpage material to png, but rather the HTML text

edit: oh you’re not taking the html material but literally just a png url

The image saves fine, but lag is intolerable.

Save the data to .dat file.

Looks like it will be fixed after next update.