![]() |
|
render.drawBeam() and textures - Printable Version +- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk) +-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html) +--- Forum: Starfall (https://teamscm.co.uk/forum-7.html) +--- Thread: render.drawBeam() and textures (/thread-3429.html) |
render.drawBeam() and textures - The17thDoctor - 22-08-2020 When drawing any textured element ( either Wireframe Box or Textured Rect ) the beam takes the last registered texture. But if nothing is drawn and we just use render.setTexture(), the beam isnt affected at all. Perhaps could drawBeam() be used alongside setTexture() without having to do some hacky rectangle drawing ? Example of code :
RE: render.drawBeam() and textures - Person8880 - 23-08-2020 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:
RE: render.drawBeam() and textures - The17thDoctor - 23-08-2020 The rect was purely to apply the material on the beam itself so I dont need it. Thanks though. |