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

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
1 2 3 4 5 … 18 Next »
Clarification about textures & materials
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
Clarification about textures & materials
26-04-2023, 08:33 PM,
#1
The17thDoctor Offline
TSCM Average Enjoyer
****
Posts: 1,100
Threads: 249
Joined: Oct 2015
Clarification about textures & materials
When I'm creating special effects, I really enjoy browsing the tons of materials and textures available (using mat_texture_list 1) but I'm quite confused as there's a ton of them that will simply not render.

Is there any "rule" that could tell if a certain texture / material can or cant be used with SF ?

The17thDoctor: Server take me to the most handsome person
srcds_linux: I cant send people to themselves...
Website Find
Reply
27-04-2023, 04:51 PM,
#2
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Clarification about textures & materials
If you're trying to set the material on an entity, then it has to be in the material tool whitelist. Otherwise, as long as it's not using a light map shader then it won't be directly blocked. However, that doesn't mean it will render correctly.

Do you have an example of a material you think should work but doesn't, and the code you're trying to use to render it?
Find
Reply
27-04-2023, 05:23 PM,
#3
The17thDoctor Offline
TSCM Average Enjoyer
****
Posts: 1,100
Threads: 249
Joined: Oct 2015
RE: Clarification about textures & materials
(27-04-2023, 04:51 PM)Person8880 Wrote: If you're trying to set the material on an entity, then it has to be in the material tool whitelist. Otherwise, as long as it's not using a light map shader then it won't be directly blocked. However, that doesn't mean it will render correctly.

Do you have an example of a material you think should work but doesn't, and the code you're trying to use to render it?

Well actually I was curious about whether lua-generated textures (such as the ones for the spore drive) are usable or not.
I've tried to use them in the past but to no avail. Although I guess its not really meant to be used anyway.

The17thDoctor: Server take me to the most handsome person
srcds_linux: I cant send people to themselves...
Website Find
Reply
27-04-2023, 05:56 PM,
#4
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Clarification about textures & materials
Ah, yes. Lua generated materials are also not exposed as they're not guaranteed to have a consistent name, and ultimately they're an internal detail of various entities.
Find
Reply
27-04-2023, 08:59 PM,
#5
The17thDoctor Offline
TSCM Average Enjoyer
****
Posts: 1,100
Threads: 249
Joined: Oct 2015
RE: Clarification about textures & materials
I also thought about :
Would there be a way to use all sorts of animated textures ? So far unless there is a material using the texture's animation, you cannot have it be animated (for instance sprites/physbeam )

The17thDoctor: Server take me to the most handsome person
srcds_linux: I cant send people to themselves...
Website Find
Reply
29-04-2023, 12:20 PM,
#6
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Clarification about textures & materials
Animations are defined by textures, not materials. Any material using an animated texture will cycle through the frames in the texture. The physbeam texture doesn't have any animation frames.
Find
Reply
29-04-2023, 12:27 PM,
#7
The17thDoctor Offline
TSCM Average Enjoyer
****
Posts: 1,100
Threads: 249
Joined: Oct 2015
RE: Clarification about textures & materials
Well I'm confused then, when looking at sprites/physbeam using the mat_texture_list 1 command, you can see that the texture has an animation.

The17thDoctor: Server take me to the most handsome person
srcds_linux: I cant send people to themselves...
Website Find
Reply
29-04-2023, 01:09 PM,
#8
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Clarification about textures & materials
Looks like GMod overrides the material for sprites/physbeam to use a static texture, whereas the Half-Life 2 texture is indeed animated. If you ask for sprites/physbeam, it's resolving the material, not the texture, hence why it's static.

If you want the animated variant, use the trails/physbeam material instead.

Edit: Actually, it turns out there is a material-level setting needed to get animations to play (specifically, it needs the "AnimatedTexture" proxy). I didn't find this when searching the Valve wiki originally. Looks like none of the materials that use the physbeam texture have this proxy so it's never animated (not even the original Half-Life 2 material). I'd assume the texture list UI is using knowledge of the VTF file to render its animation frames, which isn't something that's exposed to Lua (can only see the number of frames on a texture, but textures can only be retrieved from materials, not file paths).

Thus the only way to get this to be animated would be to generate a new material for it with the animated texture proxy, which isn't exposed to SF.
Find
Reply
29-04-2023, 02:43 PM,
#9
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Clarification about textures & materials
I've added some functions that allow for manual alterations to the texture frame of the currently set material (both 2D and 3D). See the changelog for details.
Find
Reply
30-04-2023, 12:42 PM,
#10
The17thDoctor Offline
TSCM Average Enjoyer
****
Posts: 1,100
Threads: 249
Joined: Oct 2015
RE: Clarification about textures & materials
Thanks o7

The17thDoctor: Server take me to the most handsome person
srcds_linux: I cant send people to themselves...
Website Find
Reply
« Next Oldest | Next Newest »


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