Images in Source

One thing that annoys me in the Source Engine is materials and textures. It’s an awesomely powerful system when you need it. But I don’t particularly want every texture I use on my GUI to have a generic vmt file with just the $basetexture replaced.

So I’ve made it so that in the next version of Garry’s Mod you can load png/jpeg files as simple flat textures – simply by using the filename.

Advantages?

  • Only loading one file – so half the disk access time
  • Not losing out, still got the previous system
  • More accessible
  • Potentially load images from the web straight onto the GUI

It’s pretty much as simple as it could be. It looks like this:

local mymaterial = Material( “gui/header.png” )

I’m playing around with it and exploring the¬†possibilities. The same system has scope to do some cool things.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s