Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 2 3 4 5 6 … 18 Next »
render.drawBeam() and textures
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linear Mode
render.drawBeam() and textures
23-08-2020, 10:07 AM,
#2
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: render.drawBeam() and textures
3D operations take their material from calls to render.setMaterial(), which requires a Material instance. I'm guessing that the engine is setting the 3D material somewhere inside the textured rectangle draw which is why you see it ending up on the beam.

There was a bug in the material validation in render.setMaterial() that was making it reject PNGs and other materials which will be fixed after the next restart. Here's how I changed your code to work properly:
Keeper_Beam = Material("tscm/beam_keeper2.png")

hook("render", "draw it nao", function()
local plys = find.allPlayers()
render.clear()
render.setColor(255,255,255)
-- Set the 2D rendering material.
render.setTexture(Keeper_Beam)
render.drawTexturedRect(0,0,100,100)

render.start3D()
-- Set the 3D rendering material.
render.setMaterial(Keeper_Beam)
for i = 1,#plys do
local ply = plys[i]
render.drawBeam(ents.self():pos(), ply:pos(), 2, 1, 0,Color(255,255,255))
end
render.end3D()
end)
Find
Reply
« Next Oldest | Next Newest »


Messages In This Thread
render.drawBeam() and textures - by The17thDoctor - 22-08-2020, 09:42 PM
RE: render.drawBeam() and textures - by Person8880 - 23-08-2020, 10:07 AM
RE: render.drawBeam() and textures - by The17thDoctor - 23-08-2020, 02:20 PM

  • View a Printable Version
Forum Jump:


Users browsing this thread:
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.