Please or Register to create posts and topics.

[Portal2] Reflective (cubemapped) glass?

I've run into a problem getting glass to work "right", specifically to get reflections to work right. And by reflections I mean cubemapped reflections.

I've created a small room, with four walls made of glass (thin brushes). I've added an env_cubemap and put it at eye height in the center of the room and applied one of the frosted glass materials (glass/glasswindow_frosted_002b) to the glass. They turn transparent and look almost right both in Hammer and in game, but the cubemap does not get applied. After the game starts and the map is loaded I bring down the console and write "buildcubemaps", and it looks like it's building some cubemaps allright, but after it reloads the map there's no visible difference.

I've been experimenting a lot. At some point it looked like the reflections was working using one of the other glass materials and in a prop_dynamic (bed_cover_reference.mdl) that I also have in the scene. However I can't recreate this and now I just can't get the cubemaps to work at all.

Am I missing something fundamental? I'm attaching the build log as well, but there's no real errors popping out at me:

Code: Select all
materialPath: c:program files (x86)steamsteamappscommonportal 2portal2materials
Loading c:program files (x86)steamsteamappscommonportal 2portal2mapsrcp1_00.vmf
Could not locate GameData file portal2.fgd
fixing up env_cubemap materials on brush sides...
0...1...2...3...4...5...6...7...8...9...100...1...2...3...4...5...6...7...8...9...10Processing areas...done (0)
Building Faces...done (0)
Chop Details...done (0)
Find Visible Detail Sides...
Merged 10 detail faces...done (0)
Merging details...done (0)
FixTjuncs...
PruneNodes...
WriteBSP...
done (0)
writing c:program files (x86)steamsteamappscommonportal 2portal2mapsrcp1_00.prt...Building visibility clusters...
done (0)
Finding displacement neighbors...
Finding lightmap sample positions...
Displacement Alpha : 0...1...2...3...4...5...6...7...8...9...10
Building Physics collision data...
done (0) (58483 bytes)
Placing detail props : 0...1...2...3...4...5...6...7...8...9...10
Compacting texture/material tables...
Reduced 215 texinfos to 78
Reduced 26 texdatas to 20 (887 bytes to 645)
Writing c:program files (x86)steamsteamappscommonportal 2portal2mapsrcp1_00.bsp
0 seconds elapsed

2 threads
reading c:program files (x86)steamsteamappscommonportal 2portal2mapsrcp1_00.bsp
reading c:program files (x86)steamsteamappscommonportal 2portal2mapsrcp1_00.prt
  54 portalclusters
126 numportals
0...1...2...3...4...5...6...7...8...9...100...1...2...3...4...5...6...7...8...9...10Optimized: 15 visible clusters (0.00%)
Total clusters visible: 1833
Average clusters visible: 33
Building PAS...
Average clusters audible: 53
visdatasize:1212  compressed from 864
writing c:program files (x86)steamsteamappscommonportal 2portal2mapsrcp1_00.bsp
0 seconds elapsed

[Reading texlights from 'lights.rad']
[59 texlights parsed from 'lights.rad']

Loading c:program files (x86)steamsteamappscommonportal 2portal2mapsrcp1_00.bsp
447 faces
2 degenerate faces
24887 square feet [3583830.75 square inches]
0 Displacements
0 Square Feet [0.00 Square Inches]
445 patches before subdivision
5159 patches after subdivision
104 direct lights
0...1...2...3...4...5...6...7...8...9...100...1...2...3...4...5...6...7...8...9...10transfers 530457, max 353
transfer lists:   4.0 megs
0...1...2...3...4...5...6...7...8...9...10   Bounce #1 added RGB(63320, 68200, 83661)
0...1...2...3...4...5...6...7...8...9...10   Bounce #2 added RGB(20395, 23053, 27800)
0...1...2...3...4...5...6...7...8...9...10   Bounce #3 added RGB(7070, 8343, 9884)
0...1...2...3...4...5...6...7...8...9...10   Bounce #4 added RGB(2512, 3100, 3617)
0...1...2...3...4...5...6...7...8...9...10   Bounce #5 added RGB(909, 1172, 1350)
0...1...2...3...4...5...6...7...8...9...10   Bounce #6 added RGB(332, 447, 511)
0...1...2...3...4...5...6...7...8...9...10   Bounce #7 added RGB(122, 172, 195)
0...1...2...3...4...5...6...7...8...9...10   Bounce #8 added RGB(45, 66, 75)
0...1...2...3...4...5...6...7...8...9...10   Bounce #9 added RGB(17, 26, 29)
0...1...2...3...4...5...6...7...8...9...10   Bounce #10 added RGB(6, 10, 11)
0...1...2...3...4...5...6...7...8...9...10   Bounce #11 added RGB(2, 4, 4)
0...1...2...3...4...5...6...7...8...9...10   Bounce #12 added RGB(1, 1, 2)
0...1...2...3...4...5...6...7...8...9...10   Bounce #13 added RGB(0, 1, 1)
Build Patch/Sample Hash Table(s).....Done<0.0017 sec>
0...1...2...3...4...5...6...7...8...9...10FinalLightFace Done
54 of 102 (52% of) surface lights went in leaf ambient cubes.
0...1...2...3...4...5...6...7...8...9...10Writing leaf ambient...done
Ready to Finish

Object names       Objects/Maxobjs  Memory / Maxmem  Fullness
------------       ---------------  ---------------  --------
models                   2/1024           96/49152    ( 0.2%)
brushes                174/8192         2088/98304    ( 2.1%)
brushsides            1178/65536        9424/524288   ( 1.8%)
planes                 630/65536       12600/1310720  ( 1.0%)
vertexes               768/65536        9216/786432   ( 1.2%)
nodes                  176/65536        5632/2097152  ( 0.3%)
texinfos                78/12288        5616/884736   ( 0.6%)
texdata                 20/2048          640/65536    ( 1.0%)
dispinfos                0/0               0/0        ( 0.0%)
disp_verts               0/0               0/0        ( 0.0%)
disp_tris                0/0               0/0        ( 0.0%)
disp_multiblend          0/0               0/0        ( 0.0%)
disp_lmsamples           0/0               0/0        ( 0.0%)
faces                  447/65536       25032/3670016  ( 0.7%)
hdr faces              447/65536       25032/3670016  ( 0.7%)
origfaces              395/65536       22120/3670016  ( 0.6%)
leaves                 179/65536        5728/2097152  ( 0.3%)
leaffaces              585/65536        1170/131072   ( 0.9%)
leafbrushes            261/65536         522/131072   ( 0.4%)
areas                    2/256            16/2048     ( 0.8%)
surfedges             3762/512000      15048/2048000  ( 0.7%)
edges                 2409/256000       9636/1024000  ( 0.9%)
LDR worldlights          0/8192            0/819200   ( 0.0%)
HDR worldlights        104/8192        10400/819200   ( 1.3%)
leafwaterdata            0/32768           0/393216   ( 0.0%)
waterstrips             44/32768         440/327680   ( 0.1%)
waterverts               0/65536           0/786432   ( 0.0%)
waterindices           933/65536        1866/131072   ( 1.4%)
cubemapsamples           2/1024           32/16384    ( 0.2%)
overlays                 0/512             0/180224   ( 0.0%)
LDR lightdata         [variable]           0/0        ( 0.0%)
HDR lightdata         [variable]      296016/0        ( 0.0%)
visdata               [variable]        1212/16777216 ( 0.0%)
entdata               [variable]        8697/393216   ( 2.2%)
LDR ambient table      179/65536         716/262144   ( 0.3%)
HDR ambient table      179/65536         716/262144   ( 0.3%)
LDR leaf ambient       179/65536        5012/1835008  ( 0.3%)
HDR leaf ambient       471/65536       13188/1835008  ( 0.7%)
occluders                0/0               0/0        ( 0.0%)
occluder polygons        0/0               0/0        ( 0.0%)
occluder vert ind        0/0               0/0        ( 0.0%)
Prop Hull Verts          0/0               0/0        ( 0.0%)
Prop Hull Blob           0/0               0/0        ( 0.0%)
Prop Hull Lists          0/0               0/0        ( 0.0%)
Prop Hulls               0/0               0/0        ( 0.0%)
Prop Hull trilist        0/0               0/0        ( 0.0%)
detail props          [variable]           1/12       ( 8.3%)
static props          [variable]           1/3734     ( 0.0%)
pakfile               [variable]      225165/0        ( 0.0%)
physics               [variable]       58483/4194304  ( 1.4%)
physics terrain       [variable]           2/1048576  ( 0.0%)

Level flags = 0

Total triangle count: 1358
Writing c:program files (x86)steamsteamappscommonportal 2portal2mapsrcp1_00.bsp
4 seconds elapsed

(Well except for the "Could not locate GameData file portal2.fgd", but if that really was missing nothing should be working?)

Are the glass walls the exterior, void-facing walls? If so then I'm pretty sure that won't work.

[Important Threads] Forum Rules | Welcome to the new Thinking With Portals
Please do not Private Message me for assistance. Post a thread if you have questions or concerns.
If you need to contact the staff privately, contact the Global Moderators via Discord.
msleeper wrote:
Are the glass walls the exterior, void-facing walls? If so then I'm pretty sure that won't work.

No, they're quite interior. (Basically I'm recreating chamber 00 from Portal 1 to get some practice. It's the little glass cage you start in that's not turning out quite how I want it.)

I'm assuming you are reloading your map and/or restarting Portal 2 after you build the cubemaps, right?

Also your error log looks incomplete. Looks like it starts in the middle of vvis. vbsp gives the real errors.

[Important Threads] Forum Rules | Welcome to the new Thinking With Portals
Please do not Private Message me for assistance. Post a thread if you have questions or concerns.
If you need to contact the staff privately, contact the Global Moderators via Discord.
msleeper wrote:
I'm assuming you are reloading your map and/or restarting Portal 2 after you build the cubemaps, right?

Also your error log looks incomplete. Looks like it starts in the middle of vvis. vbsp gives the real errors.

I'm reloading the map (actually portal 2 does that automatically after buildcubemaps). I haven't tried rebooting portal 2 specifically yet.

The top of the output I linked is from vbsp.exe. It always starts with "materialPath: blah blah".

Wow. I tried building cubemaps and then immediately rebooting P2 and then running the map again. Et voila the cubemaps on the prop_dynamic was working again. (And also on some of the metal textures I noticed.)

No luck on the glass, but I guess I could go hunting for that glass material where it worked.

Is there any way to get a material to support cubemapped reflections if it isn't already "baked in"?

The cubemaps are a lot more subdued than in Portal 1 though. Wonder why...

I think it might just be that texture. I don't think any of the glass really has an overly obvious specularity to it. Subtlety works!

[Important Threads] Forum Rules | Welcome to the new Thinking With Portals
Please do not Private Message me for assistance. Post a thread if you have questions or concerns.
If you need to contact the staff privately, contact the Global Moderators via Discord.