We hate ads too, but they're a necessary force that keeps SFMLab afloat. Support us on patreon to remove all ads.

CubeMapper - Easily build cubemaps




Description

Have you ever compiled a map for SFM only to see glowing rainbow blobs everywhere? Or no reflections showing up at all?
No worries, with CubeMapper, building cubemaps has never been easier! </infomercial>

CubeMapper is a simple tool that allows building cubemaps (reflections on models and world geometry) without much hassle involved. It uses Portal 2's similar engine to do what SFM always dreamed of doing: allowing amazing reflections in your posters for any map!
Before you start wondering why you wouldn't be doing this directly in SFM: it simply doesn't work. [1] [2]

Instructions:

  1. Create a map. Place env_cubemaps into it (crank up the resolution of those to 256x256 if you don't mind huge files). Be sure it is saved inside of one of SFM's mod folders (like game/usermod/maps/blah.bsp). The name should not be longer than 30 characters total
  2. Compile your map using SFM's Hammer Editor (be sure not to rename your file after compiling it!)
  3. Open CubeMapper.exe
  4. Drag&Drop the map file you wish to create cubemaps for into the input textbox (or just browse for it)
  5. If the portal2.exe did not get set automatically, do so yourself
  6. Go to Edit Mods and make sure only the mods you really need are enabled, since more mods means more loading times, and may cause conflicts (Portal 2 is always loaded)
  7. If no other warnings show up under the Notes section, press Start and wait for Portal 2 to launch
  8. Once the map loaded, press F1, sit back and relax
  9. Once Portal 2 closed itself, go into SFM and enjoy your amazingly reflective map!

Questions:

Q: Why does the program not launch?

A: CubeMapper requires the .NET Framework 4.5.2 or later. Download here! Also make sure all files from the ZIP are extracted to a folder and not run from inside the archive.

Q: Why does Portal 2 instantly close when I press F1?

A: Your screen resolution probably is too small (width and height have to be >1024 pixels). Add the following lines to the end of the Arguments textbox: -w 1025 -h 1025 -windowed

Q: Portal 2 crashes on startup?

A: Be sure that CubeMapper is run as an administrator.

Q: Everything is purple-black checkerboards and errors?

A: Portal 2 has to be installed in the same Steam library folder as Source Filmmaker in order for the files to be found, since only relative paths can be used in gameinfo.txt files. You may also simply need to enable the mods which are responsible for the content that is missing (see the Edit Mods dialog).

Q: What if I don't own Portal 2?

A: I personally have never tried, but according to others, Alien Swarm works as well and is free. See if it works out for you!

Q: My map doesn't look reflective! Why do you lie to me?

A: If you follow the instructions above, everything should work out. If you are trying it on a map you didn't compile, it may be related to other files being packed into the BSP or the map simply not having cubemaps to begin with. Shining SFM lights onto your surfaces may also cause them to look less reflective. SFM also seems to cache cubemap data, so try restarting SFM or running mat_reloadallmaterials after building your cubemaps.

Q: What are these glowing orbs in my reflections?

A: I am not sure what causes them, but they show up on every light entity. It may be intentional, to better show lights in reflections, but who knows.

Q: Can I see the source code?

A: Once someone actually asks this, I'll release it. Since there's not many people interested in that kind of thing, setting up a git repository just for the sake of having it is not worth the effort, in my opinion.

We hate ads too, but they're a necessary force that keeps SFMLab afloat. Support us on patreon to remove all ads.

Comments

This program seems to resemble Crowbar a lot, as in it borrows something from the game and acts as a shortcut to controlling it and giving the user the ability to produce results they wish. the only sucking part is that this doesn't work for models. Someday, we should have the ability to fake PBR with a moving cubemap based on location, but for now, I can only fake PBR using the Blinn method and the RT_camera Blinn method.

The mods list in "Edit Mods" is empty for some reason, so every map I load is full of missing stuff. Did I miss something?

RedMser

@ShawaZawa It isn't really easy to make programs work 100% flawlessly on every setup without anybody to test it.
I appreciate the feedback, but can't really help to make it better without any clear reports of what is not working (for example, "doesn't properly copy materials", it isn't even supposed to copy anything over, since it loads the data using gameinfo.txt entries).
I have updated the program since, so that might have fixed some issues you were having with it.

@modesskiy774 What do you mean that it doesn't work with models?
If you have at least one env_cubemap in your map (which doesn't have any faces marked) and the model uses the entry $envmap env_cubemap in its VMT file, the cubemaps should work fine. If they look like your skybox texture, you don't have any cubemaps in your level or all cubemaps have faces assigned to them. If it looks like the default cubemap, then building cubemaps didn't work correctly (might be caused by another engine version being used to compile the map).
But yeah, moving cubemaps and the like probably won't ever be possible in SFM. The closest you can get to having those is indeed by using something like rendertarget cameras.

@splishevsky I have launched a fix that should allow you to, even if your gameinfo.txt still can't be read or found, add your mod entries manually.

Sub

@RedMser - You act is if I didn't read your tutorial text steps. I did it all but it didn't work. I guess i'll wait for a tutorial or somethin.

I followed all of the tutorial steps, having a repeating issue with the maps I run through this program.

All of the brushes in my maps are either transparent or not rendering, which is strange considering they work in SFM. I tried moving all of the materials from my SFM modset into Portal 2 to see if this would fix the issue, no luck there as well.

I've read Portal 2 has issues with custom skyboxes as well which I do not have on any of the maps I'm using. I also have all of the SFM mods necessary selected before running the application, and no notes that suggest anything is wrong. Curious to see what's causing this.

I don't know if it's just me, or this tool doesn't work because it doesn't fix the cubemaps, when I pressed F1, yes, the cubemap building works, but it close itself without overwriting the existing map.

Hi_im_a_Weeaboo

Very handily, thank you very much kind sir! ;D

Leave a reply


You need to be logged in to leave a comment.



RedMser  • RedMser

We hate ads too, but they're a necessary force that keeps SFMLab afloat. Support us on patreon to remove all ads.