I wonder how can you disable light on materials ?
Here is my code :
function ENT:Draw()
if self.Panel && self.Panel:GetHTMLMaterial() then
local htmlMat = self.Panel:GetHTMLMaterial()
local scaleX, scaleY = ScrW() / 2048, ScrH() / 2048
local matData = {
["$basetexture"] = htmlMat:GetName(),
["$basetexturetransform"] = "center 0 0 scale " .. scaleX .. " " .. scaleY .. " rotate 0 translate 0 0",
["$model"] = 1
}
local uid = string.Replace(htmlMat:GetName(), "__vgui_texture_", "")
self.Mat = CreateMaterial("WebMaterial_" .. uid, "VertexLitGeneric", matData)
end
self:DrawModel()
if self.Mat then
local DrawPos = self:LocalToWorld(Vector(1, -111, 58))
local DrawAngles = self:GetAngles()
DrawAngles:RotateAroundAxis(self:GetAngles():Forward(), 90)
DrawAngles:RotateAroundAxis(self:GetAngles():Up(), 90)
cam.Start3D2D(DrawPos, DrawAngles, 0.4)
surface.SetDrawColor(0, 0, 0, 255)
surface.SetMaterial(self.Mat)
surface.DrawTexturedRect(0, 0, 558, 290)
cam.End3D2D()
end
end
output :
Maybe shaders?
Though this doesn’t solve your problem, I think what you’re trying to achieve would best be executed by opening your webpage in a 3d2d derma panel rather than setting GetHTMLMaterial on a model’s submaterial. I couldn’t find a shader that makes it render fullbright, I know you can make the entire model ignore lighting with render.SuppressEngineLighting which could help for the time being.
Replace
VertexLitGeneric
with
UnlitGeneric
Still doing some shit reflects but its nicer
Interesting, the valve developer wiki says that would cause issues, guess not in Gmod though. The more you know.
You can close the thread, and mark my solution as correct imo
Sorry, you need to Log In to post a reply to this thread.