Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- old
- function EGP:SetMaterial( Mat )
- if (!Mat) then
- surface.SetTexture()
- elseif (type(Mat) == "string") then
- surface.SetTexture( self:CacheMaterial( Mat ) )
- elseif (type(Mat) == "Entity") then
- if (!Mat:IsValid() or !Mat.GPU or !Mat.GPU.RT) then return end
- local OldTex = WireGPU_matScreen:GetMaterialTexture("$basetexture")
- WireGPU_matScreen:SetMateriature("$basetexture", Mat.GPU.RT)
- surface.SetTexture(surface.GetTextureID( "GPURT" ))
- return OldTex
- end
- end
- -- new
- function EGP:SetMaterial( Mat )
- local OldTex = WireGPU_matScreen:GetMaterialTexture("$basetexture")
- if (!Mat) then
- surface.SetTexture()
- elseif (type(Mat) == "string") then
- surface.SetTexture( self:CacheMaterial( Mat ) )
- elseif (type(Mat) == "Entity") then
- if (!Mat:IsValid() or !Mat.GPU or !Mat.GPU.RT) then return end
- WireGPU_matScreen:SetMateriature("$basetexture", Mat.GPU.RT)
- surface.SetTexture(surface.GetTextureID( "GPURT" ))
- end
- return OldTex
- end
Advertisement
Add Comment
Please, Sign In to add comment