1. Forums
  2. Discord
  3. About Mapcore
  4. Patreon Supporters
  • Login
  • Register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • More Options
  1. Mapcore
  2. Discussions
  3. Level Design

VTF and light bounce

  • robert.briscoe
  • September 21, 2008 at 1:46 PM
  • robert.briscoe
    • September 21, 2008 at 1:46 PM
    • #1

    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?

  • Nurb
    • September 21, 2008 at 1:53 PM
    • #2

    viewforum.php?f=34

  • robert.briscoe
    • September 21, 2008 at 2:02 PM
    • #3

    ah bugger, sorry. Can someone move to the appropriate forum

  • Defrag
    • September 27, 2008 at 5:15 PM
    • #4

    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.

  • Buddy
    • September 27, 2008 at 6:43 PM
    • #5
    Quote from Defrag

    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.

  • e-freak
    • September 27, 2008 at 7:04 PM
    • #6

    Decreasing Texture Brightness, installing a VMT Proxy to change the texture ingame to the bright one?

  • robert.briscoe
    • September 27, 2008 at 7:13 PM
    • #7

    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.

  • ifO
    • September 28, 2008 at 4:54 PM
    • #8

    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.

  • ifO
    • September 28, 2008 at 8:36 PM
    • #9

    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:

    Code
    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!

    [Blocked Image: http://xs231.xs.to/xs231/08390/here368.jpg]

    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.

  • robert.briscoe
    • September 28, 2008 at 9:51 PM
    • #10

    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.

  • ifO
    • September 28, 2008 at 11:05 PM
    • #11

    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

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

  • robert.briscoe
    • September 29, 2008 at 9:02 AM
    • #12

    Btw does anyone know how to convert rgb values into this strange 0-1 decimal system?

  • robert.briscoe
    • September 29, 2008 at 11:10 AM
    • #13

    Ok here's my results so far:

    [Blocked Image: http://www.littlelostpoly.co.uk/PVT/Misc/reflect_tst1.jpg]

    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.

  • Josch
    • September 29, 2008 at 11:30 AM
    • #14

    Wow! Very impressive :megaman:

  • -HP-
    • September 29, 2008 at 11:31 AM
    • #15
    Quote from robert.briscoe

    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

  • ifO
    • September 29, 2008 at 6:20 PM
    • #16

    Ah nice, that's pretty cool, thanks for sharing!

    If your aim was to multiply the original reflectivity values, I could actually stick in another option that would do that for you. And would you rather go from VTF to VTF rather than have an intermediate TGA stage?

    So I'm suggesting something like:

    vtfcmd -reflectmultiply 2.0 2.0 2.0

    (to take an existing vtf, multiply it's reflectivity values by 2, and output to vtf)

    If you let me know exactly what functionality you want I can try to edit the tool to suit. It shouldn't have to be a fiddly process!

    For now I'll take down the link, until I've spoken to Nem or Wunderboy about it.

  • robert.briscoe
    • September 30, 2008 at 4:12 PM
    • #17

    what would be awesome would be if i could make say 3 batch files, each with a command line parameter which specifies the multiplier (as you mentioned above) and just be able to drag and drop any vtf onto the .batch files and it updates the dragged vtf. Kinda like how I compile my models atm. Each folder with my qc files in has a batch file for studiomdl that looks like this:

    Code
    @echo off
    
    
    "%sourcesdk%\\bin\orangebox\bin\studiomdl.exe" "%1"
    
    
    pause

    and i just drop the qc onto it to compile my models no matter where they are.

    What do you think? possible?

  • ifO
    • October 3, 2008 at 12:45 PM
    • #18

    Shouldn't be a problem, I'll take a look at it this wkend

  • robert.briscoe
    • October 4, 2008 at 3:35 PM
    • #19

    awesome thanks!

  • Wunderboy
    • October 5, 2008 at 2:37 PM
    • #20

    Nice work

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!

Register Yourself Login
Discord

The Mapcore Discord is our lively IRC channel of the 2000s reborn. Chat about level design, gaming, and more.

Latest Posts

  1. Tangerine

    Harry Poster
    July 18, 2026 at 11:10 AM
  2. Any of the old guard still around? D:

    Warby
    July 12, 2026 at 8:23 PM
  3. About our archived forums

    Thrik
    June 30, 2026 at 2:12 PM
  4. Mapcore Discord

    mason_fan123
    June 24, 2026 at 8:52 PM
  5. [CS2] Valley

    Serialmapper
    June 22, 2026 at 11:56 AM
  6. Free Music / SFX Resource - Over 2500 Tracks

    Eric Matyas
    June 18, 2026 at 12:32 PM
  7. Pango [WIP]

    Elowen
    June 11, 2026 at 10:13 AM
  8. [CS2] Dvina

    Jeremy Rivera
    June 11, 2026 at 10:03 AM
  9. Bridges 2.0 by NEXSIDE, MAP SHOWCASE. ( Steam Workshop )

    MrTrane18
    June 1, 2026 at 7:46 PM
  10. Classic Maps Reborn For CS2

    SillySpaceCat
    May 31, 2026 at 10:33 PM

Users Viewing This Thread

  • 2 Guests
  1. Privacy Policy
  2. Contact
Powered by WoltLab Suite™