robert.briscoe Posted September 21, 2008 Report Share Posted September 21, 2008 Hi guys, Im trying to find out how to change the light transmittance (light bounce strength) of vtf files. I know this is possible as i've seen it used with the dev/reflectivity textures. At the moment all of the vtf compilers and plugins available seem to calculate this automatically but i want to be able to set it manually somehow. Apparently its all in the VTF header but i havent been able to figure out how to edit VTF header info. Has anyone done this before? Quote Link to comment Share on other sites More sharing options...
Nurb Posted September 21, 2008 Report Share Posted September 21, 2008 viewforum.php?f=34 Quote Link to comment Share on other sites More sharing options...
robert.briscoe Posted September 21, 2008 Author Report Share Posted September 21, 2008 ah bugger, sorry. Can someone move to the appropriate forum Quote Link to comment Share on other sites More sharing options...
Defrag Posted September 27, 2008 Report Share Posted September 27, 2008 I was under the impression that it's just done via the actual colour values in the texture. I.e. brighter textures reflect more light during RAD. I could be wrong, though. Quote Link to comment Share on other sites More sharing options...
Buddy Posted September 27, 2008 Report Share Posted September 27, 2008 I was under the impression that it's just done via the actual colour values in the texture. I.e. brighter textures reflect more light during RAD. I could be wrong, though. You're right but what Rob is looking for is the way of manually tweaking the value which would not affect the texture. Quote Link to comment Share on other sites More sharing options...
e-freak Posted September 27, 2008 Report Share Posted September 27, 2008 Decreasing Texture Brightness, installing a VMT Proxy to change the texture ingame to the bright one? Quote Link to comment Share on other sites More sharing options...
robert.briscoe Posted September 27, 2008 Author Report Share Posted September 27, 2008 huh? Im not sure what you mean there. Yes you are right in that, atm, it automatically looks at the texture, its overall colour and brightness and creates a bounce colour value and strength based on that information (When saving the VTF). However, although suitable for most situations, it doesnt always provide acurate results. In the header there is a vaule for this which looks something like this: Transmittance 128 97 28 10 The first three values are of course rgb and the final is the power of the colour bounce/reflectivity/light transmittance (whatever you want to call it) which is only read by VRAD when calculating bounce in the lightmap compile. All I want to do is increase the power value so that my materials have more reflective power, however there is no way I know of editing the header info to tweak it, or set it maunally when saving the VTF. Quote Link to comment Share on other sites More sharing options...
ifO Posted September 28, 2008 Report Share Posted September 28, 2008 Interesting. I wasn't aware of this until you brought it up, but I had a dig around and I think if you ask Nem very nicely he might add an option to the VTFcmd tool to allow you to set the reflectivity. http://nemesis.thewavelength.net/index.php?c=177#p177 Currently there is only a -noreflectivity option to disable its calculation but from a quick glance at the code it looks like it wouldn't take much to add the ability to manually set it. Quote Link to comment Share on other sites More sharing options...
ifO Posted September 28, 2008 Report Share Posted September 28, 2008 So lucky for you I'm going through an 'interested in programming phase'. I know, sad but you can blame it on my new job. I took a look at the code and it only took about 5 new lines to add in the option to set reflectivity. Thanks to Nem and Wunderboy for having the code in such nice order You will want to download VTFEdit from the link above. (I'm not sure if you get VTFCmd with it, if not download the VTFlib package too.) Then copy this modified version of VTFCmd to the same folder as the default one: VTFCmd_r.rar (Edit: Link removed until I talk to the coders -ifO) Then you should be set. Here's an example run I did: VTFCmd_r.exe -file ifO_cgbrick02y.tga -format dxt1 -mfilter box -reflectivity 0.6 0.6 0.6 -noreflectivity NOTE: you must use -noreflectivity option (to disable standard calculation) as well as specifiying your desired values using -reflectivity. Then open up the resulting VTF and check in the info tab, all looks good! I'd be interested to see what results you get with this. Keep us informed if it's at all useful! NOTE: Of course this file is useless without installing the original package, but still PLEASE DO NOT REDISTRIBUTE it, especially don't repackage this in with Nem's files or anything silly like that. I will contact Nem to make a proper addition if it proves to be worthwhile. I will take the link down shortly too. Quote Link to comment Share on other sites More sharing options...
robert.briscoe Posted September 28, 2008 Author Report Share Posted September 28, 2008 thanks for that! I will have a tinker tomorrow and see what results I get. Hopefully its not too fiddly with the command prompt stuff, I'll have a lot of textures that will need to be tweaked. Quote Link to comment Share on other sites More sharing options...
ifO Posted September 28, 2008 Report Share Posted September 28, 2008 No problem, hope it works! A handy technique is to put any frequently used command in a batch file with %1 in place of wherever the input file should go, then you just drag and drop all your input files onto it. Combine this with VTFCmd's handy recursive option, which allows you to pass it a folder of input files and make a batch file like this: multi.bat vtfcmd_r.exe -folder %1\*.tga -recurse -reflectivity 0.4 0.5 0.6 -noreflectivity ... then drag a folder full of input .tga's onto it and it will VTF them all for you. Quote Link to comment Share on other sites More sharing options...
robert.briscoe Posted September 29, 2008 Author Report Share Posted September 29, 2008 Btw does anyone know how to convert rgb values into this strange 0-1 decimal system? Quote Link to comment Share on other sites More sharing options...
robert.briscoe Posted September 29, 2008 Author Report Share Posted September 29, 2008 Ok here's my results so far: Gives alot more ambient light in indoor areas which is pretty nice. However I still found the whole process of tweaking the vaules of the textures very fiddly and drawn out, especially considering I'd have to tweak colours and strength on a per-texture basis, so im not sure im gonna use this just yet, but it nice to see the results of it. Quote Link to comment Share on other sites More sharing options...
Josch Posted September 29, 2008 Report Share Posted September 29, 2008 Wow! Very impressive :megaman: Quote Link to comment Share on other sites More sharing options...
-HP- Posted September 29, 2008 Report Share Posted September 29, 2008 Btw does anyone know how to convert rgb values into this strange 0-1 decimal system? Yeah, you must divide by 255, that's what I have to do here at work. example: R100 G40 B40 = R0.39 G0.15 B0.19 100 / 255 = 0.39 40 / 255 = 0.15 50 / 255 = 0.19 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.