Facepunch / garrysmod-requests

Feature requests for Garry's Mod
83 stars 24 forks source link

Add Lua created procedural textures #605

Open Jcw87 opened 8 years ago

Jcw87 commented 8 years ago

Currently, the only way to create textures from alternative file formats (doom WADs, for example) is to create a render target and draw a colored rectangle for each pixel. This is really slow, and causes needless slowdowns while texture 'loading' happens.

If we could create procedural textures, and directly feed pixel data into them, these textures could be loaded much faster. I created a module that does exactly this some time ago, as I was working on something that REALLY needed the faster pixel throughput.

For clarification, there are a few things in the module that I was using for testing, and are not part of this request. I'm requesting the following:

paintmap.CreateProceduralTexture as render.CreateProceduralTexture or just CreateProceduralTexture ITexture:UpdateProceduralTexture all of the TEXTUREFLAGS constants

This one might be helpful too:

ITexture:GetImageFormat

thegrb93 commented 8 years ago

Wire digital screen and would benefit greatly from this too.

UselessGhost commented 4 years ago

I know there's been no movement on this since it was created but I think this would be an excellent addition -- any chance for it to get added?

Jcw87 commented 4 years ago

Willox has been busy lately with chromium and 64-bit. I imagine this is a low priority until those are finally sorted out.

As long as I'm here, since I initially created this issue, it has come to my attention that some of the methods I used for loading texture data may not have been the absolute fastest way of doing it (but it's still way faster than rendering rectangles to individual pixels), so you may not want to use the exact implementation that I used.