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 »
UV issue in drawTexturedRect
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pages (2): « Previous 1 2
Threaded Mode
UV issue in drawTexturedRect
12-07-2020, 02:04 PM, (This post was last modified: 12-07-2020, 02:09 PM by Tomeno. Edited 5 times in total.)
#11
Tomeno Offline
TSCM Member
***
Posts: 10
Threads: 3
Joined: Jul 2020
RE: UV issue in drawTexturedRect
Found a material that doesn't seem to work with Material();
--@highres true
local mat = Material("spacebuild/hazard2.vmt")
local tex = render.getTextureID("spacebuild/hazard2.vmt")
hook( "render", "render", function()
render.clear()
render.setMaterial(mat)
render.setColor(255, 255, 255, 255)
render.drawTexturedRect(0, 0, 512, 512)
render.setTexture(tex)
render.setColor(255, 255, 255, 255)
render.drawTexturedRect(512, 0, 512, 512)
end)
If you remove the .vmt from the end of the material path for "tex", it'll stop drawing as well. The presence of an extension has no effect on "mat".

EDIT: I thought I tried it, but using setTexture with "mat" makes it draw now... Must be my fault then.
EDIT 2: Oh. It only works in a HUD, and it has lighting applied. Doesn't work on a screen.
Find
Reply
12-07-2020, 02:19 PM,
#12
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: UV issue in drawTexturedRect
That material is using the "VertexLitGeneric" shader so it won't render properly on a screen. That's a case where you do want to use render.getTextureID(), as it sets up the appropriate shader for it to render without lighting.

The following works fine for me:
--@highres
local tex = render.getTextureID("spacebuild/hazard2")
hook( "render", "render", function()
render.clear()
render.setTexture(tex)
render.setColor(255, 255, 255, 255)
render.drawTexturedRect(512, 0, 512, 512)
end)
The file extension doesn't seem to make a difference, it resolves to the same material either way.
Find
Reply
12-07-2020, 02:48 PM,
#13
Tomeno Offline
TSCM Member
***
Posts: 10
Threads: 3
Joined: Jul 2020
RE: UV issue in drawTexturedRect
Ah. Using the material as a Texture without an extension doesn't work for me, but it seems to for other people.
Find
Reply
12-07-2020, 02:51 PM,
#14
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: UV issue in drawTexturedRect
Might be worth restarting the game, as it may be holding on to a previous instance of the material from before the fixes.
Find
Reply
« Next Oldest | Next Newest »
Pages (2): « Previous 1 2


  • 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.