CapsAdmin

Untitled

Jan 5th, 2012
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. -- old
  2. function EGP:SetMaterial( Mat )
  3.     if (!Mat) then
  4.         surface.SetTexture()
  5.     elseif (type(Mat) == "string") then
  6.         surface.SetTexture( self:CacheMaterial( Mat ) )
  7.     elseif (type(Mat) == "Entity") then
  8.         if (!Mat:IsValid() or !Mat.GPU or !Mat.GPU.RT) then return end
  9.         local OldTex = WireGPU_matScreen:GetMaterialTexture("$basetexture")
  10.         WireGPU_matScreen:SetMateriature("$basetexture", Mat.GPU.RT)
  11.         surface.SetTexture(surface.GetTextureID( "GPURT" ))
  12.         return OldTex
  13.     end
  14. end
  15.  
  16.  
  17. -- new
  18. function EGP:SetMaterial( Mat )
  19.     local OldTex = WireGPU_matScreen:GetMaterialTexture("$basetexture")
  20.  
  21.     if (!Mat) then
  22.         surface.SetTexture()
  23.     elseif (type(Mat) == "string") then
  24.         surface.SetTexture( self:CacheMaterial( Mat ) )
  25.     elseif (type(Mat) == "Entity") then
  26.         if (!Mat:IsValid() or !Mat.GPU or !Mat.GPU.RT) then return end
  27.         WireGPU_matScreen:SetMateriature("$basetexture", Mat.GPU.RT)
  28.         surface.SetTexture(surface.GetTextureID( "GPURT" ))
  29.     end
  30.     return OldTex
  31. end
Advertisement
Add Comment
Please, Sign In to add comment