Talk:Procedural Materials

From Valve Developer Community
Jump to: navigation, search

Dude. Woah. --TomEdwards 13:35, 22 Jul 2005 (PDT)

You can use these for skyboxes, yeah? --Pon

I don't think so. Sky-textures are special materials --King2500 06:09, 23 Jul 2005 (PDT)

Hmm, that might be worth trying. --ZeroDegrez 06:28, 23 Jul 2005 (EST)

Yes, they can be used as skybox textures ;) It's pretty cool watching Red vs. Blue in skybox, lol --ZeroDegrez 10:40, 25 Jul 2005 (EST)

What we need is an animated cube of roiling, rain-drenched thunderclouds, complete with lightning... --Cargo Cult 08:21, 25 Jul 2005 (PDT)
Now you're talking. Someone get to work on a procedural cloud image generator. Not it! --ZeroDegrez 4:40, 25 Jul 2005 (EST)
If I recall correctly, www.shader.org had some pretty nifty cloud shaders... It shouldn't be that hard to port one to C++... And a couple might even be in HLSL :D -- Pon
Hmm, I don't know how this works, but if this is sent from a server, could cameras be rigged on top of a real live building, taking five pictures in each direction each minute or so, providing the level with a real up-to-date skybox, including weather and time of day? That would be creepy. =) --Andreasen 04:06, 28 Sep 2006 (PDT)

imagedata

Wait a tick... What happens to imagedata? After the x/y looping, it would seem that it doesn't go back into the texture :S -- Pon

Doesn't need to, the imagedata is a direct pointer to the texture in memory (I Assume), but in any case if you edit a pixel it either immediately updates, or the engine does something with the VTFTexture after it calls the Regenerate method. You do not need to do anything else besides modify imagedata for your changes to appear, that I know. :) --ZeroDegrez 09:08, 26 Jul 2005 (EST)
Ah, ok cool, I missed that lol.-- Pon

Procedural Materials Not Working?

Does anyone currently have a working version of procedural materials? One of the patches to HL must have broken something. The code I had sitting on my harddrive has stopped working. I've done some debugging and I'm not sure what the problem is. Other than to say when I write to the memory where the procedural should be, the game crashes. Also when attempting to get the image format of what I'm trying to write to I get 2024, which doesn't correspond to any of the options. The object that maintains all that info is not bad...it still holds the proper dimension information for the texture and the like. But attempting to write to its memory or access the imageformat does not appear to be working correctly.

There is also no crash log... -- ZeroDegrez 12/ 28 / 2005

I had the same problem. I think the pVTFTexture argument isn't setup properly. I'll post if I make any progress with it.-- Ndnichols 8/9/2006

Procedural Materials Now Working

This was apparently fixed in the 8/4/06 update. Following the instructions on the page now works properly. (Thanks a lot, Mike Durand.) I removed the warning on the front page. I'm working now on integrating AVI playback, I'll post code when it goes (presumably in a few days.) --Ndnichols 11:49, 5 Sep 2006 (PDT)

It works just like it use to now :) Thanks everyone who kept trying to get this working. --ZeroDegrez

Drawsettexturergba

Is using procedural materials prefered over using DrawSetTextureRGBA (of which the inner workings are questionable last time I checked)? --deathz0rz 13:47, 26 Sep 2006 (PDT)

Alpha channel

The original article mentioned something about the texture always being BRGX8888. I haven't thoroughly tested all the options, but if you set $translucent in the VMT and import the VTF with VTF setting both image formats to BGRA8888, you can use the alpha channel. So I made some modifications to the article. --deathz0rz 13:05, 27 Sep 2006 (PDT)