source-sdk-2013 icon indicating copy to clipboard operation
source-sdk-2013 copied to clipboard

cubemaps not working

Open Freshz24 opened this issue 13 years ago • 27 comments

I see this issue quite everywhere now, the cubemaps don't seem to work.

I can use the buildcubemaps command normally but it has no effect. Deleting the default black cubemaps from the bsp file leaves me with pink/black textured reflective floor.

Where does this issue come from?

Freshz24 avatar Jun 29 '13 13:06 Freshz24

Same problem here

ghost avatar Jul 01 '13 01:07 ghost

Seems to be an in-engine error. If you were to port the maps to the 2007 engine, it will build normally.

reepblue avatar Jul 01 '13 08:07 reepblue

Same

221boy221 avatar Jul 02 '13 09:07 221boy221

Bump ! because this is Major issue, please guys do something about that, the version of the source base 2013 is not an acceptable version to work with.

There is something i can't catch in your strategy, the time pass , and I am now really sceptical about the 2013 SDK, I know that Source 2007 will never being steampiped, and I have a strong feel that Sourcesdk and the older sdk base will be removed very soon. Valve, are you into breaking all mods and all the support the community of developer helped to build around the source engine ? if you want to know what the community wants. It's kind of simple Community Developer on Source engine wants to know what are the Valve plan for the source Engine 2, that all. some developer wants to know if it will be possible to lately port their project to the source Engine 2. Currently we just want to be sure that base 2006 and 2007 will be maintained for a time.

Nicolas Kirsch

ghost avatar Jul 10 '13 19:07 ghost

BTW seems this is not only Source2013 issue, other "new" steampipe games has same problem.

Barnacle avatar Jul 11 '13 07:07 Barnacle

I can confirm that Episode 2 has this issue as well. "buildcubemaps" begins the process, and flashes all the cube maps on the screen, but none of them are apparently getting baked out to the map itself. I have yet to find any solution. The one claimed solution on the Steam forums did not work for me: http://forums.steampowered.com/forums/showpost.php?p=34643902&postcount=21

Can anyone else confirm success or failure on the above approach?

EDIT: https://github.com/ValveSoftware/Source-1-Games/issues/860

Riomaki81 avatar Jul 20 '13 15:07 Riomaki81

Really? It worked for me. Like I noted on the steam forums, what are supposedly the cube map .vtf files aren't being initially saved properly. If you open them up in Pakrat, they appear black. However, if you delete said .vtfs, save the .bsp, reload the map, build the cube maps, then they work.

Here are some pics for you.

initial cube maps fixed cube maps

Of course, the actual problem is that this wasn't and shouldn't be happening in the first place. For now, this is just a workaround until an actual solution is found.

dessertmonkeyjk avatar Jul 21 '13 05:07 dessertmonkeyjk

Thank you, it looks like that technique does work. I suspect my problem was that I got confused over which .bsp I was editing. For me, the .bsp file is outputted to both sourcesdk_content/ep2 (where the .vmf lives) and /ep2/maps in /common. I was editing the one in sourcesdk_content when it should have been the other one.

Riomaki81 avatar Jul 21 '13 17:07 Riomaki81

Hmm, I could not get this to work for me. I also tried building cubemaps in 2007 and then playing the map in 2013, but the default black cubemap texture over written my cubemap build.

reepblue avatar Jul 21 '13 20:07 reepblue

Any idea if Valve is fixing this anytime soon?

ShockaPop avatar Jul 29 '13 16:07 ShockaPop

The VBSP source is included in the 2013 SDK, if you comment out "Cubemap_CreateDefaultCubemaps" on line 860 of vbsp.cpp and compile your own version then VBSP will stop writing out the black cubemaps. After that, it's just a matter of building the cubemaps like normal, works fine for my 2013 based mod.

jimbomcb avatar Jul 29 '13 20:07 jimbomcb

Thank you John, it work well to for me: Also I have generated vbsp for SP and Mp, and it can be downloaded here: http://puppet-master.net/download/Source_SDK_base_2013/vbsp/vbsp-fix-source-2013.rar Just a question do you planned to submit a pull request ?

ghost avatar Jul 29 '13 21:07 ghost

I don't plan on it because I don't consider stomping out all cubemap generation in VBSP a reasonable solution. I'd rather Valve figure out the root cause behind buildcubemaps not overwriting the files than do a dodgy fix.

jimbomcb avatar Jul 29 '13 21:07 jimbomcb

I think the point of creating "default" black textures for cubemaps in VBSP is so the first time (and every time with new cubemap entities) you build the map, you don't have to go through the process of making cubemaps, which eases the process of quickly prototyping out elements. I agree though that Valve should fix this ASAP

EDIT: Though, isn't there a default envmap texture the game falls back to, if cubemaps aren't present at the time of build?

tealsuki avatar Jul 30 '13 13:07 tealsuki

i am not sure about, but if the default cubemap are all black, it's may be related to a skybox issue instead of cubemap. As the code of vbsp.exe for source 2007 episodic is exactly the same than 2013, accepted that a pointer has been added to manage the map component to refer to.

ghost avatar Jul 30 '13 17:07 ghost

How to fix HDR cubemaps :

1. Fix the VMT files :

Vbsp is looking for a $hdrbasetexture variable, and from the VPK and the skyday01_01_hrd and skyday02_01_hrd Materials file, the $hdrbasetexture variable is missing, instead of that, VBSP will not being able to grab that variable from the material file. So i just have extracted all the vmt and vtf and added $hdrbasetexture "skybox/skyday01_01hdrrt". like that :

"sky"
{
    "$hdrcompressedTexture" "skybox/sky_day02_01_hdrrt"
    "$hdrbasetexture" "skybox/sky_day02_01_hdrrt"
    "$nofog" "1"
    "$ignorez" "1"
    "$basetexturetransform" "center 0 0 scale 1 2 rotate 0 translate 0 0"
    "$basetexture" "skybox/sky_day02_01rt"
}

2. Compile the maps with the modified VBSP

About the VBSP fix, and as vbsp don't not create the default cubemap, the game must be set without hdr enable, to build the LDR cubmaps. And so the ldr cubemap will be written into the bsp file. No for the HDR cubemaps, you must to set the video properties to HDR enable, reload the maps and do the buildcubemap again.

Note : It's important to build the cubemaps in that order : ldr > hdr.

Bugs : I notice another issue with buildcubemaps executed directly ingame I must to execute the buildcubemaps command a second time, because some of my VertexLitGeneric materials are not affected by the env_cube.

ghost avatar Aug 02 '13 16:08 ghost

I've been getting only half my map to build the cubemaps fine and the other half I've gotten purple and black reflections. I've been using my own custom skybox with "$hdrcompressedTexture". I may try building the cubemaps in ldr, then hdr, although I doubt it will fix my problem

reepblue avatar Aug 04 '13 05:08 reepblue

the next problem i discovered about the cubemap, is that sdk base 2013 have a "plateform/materials/engine/defaultcubemap.vtf" the default cubemap are named cubemapdefault.vtf, aslo cubemapdefault.hdr.vtf, is totally missing. with hdr sky you will have to use buidlcubemap two times, just to remove the pink/black colour that comes from the missing cubedefault.hdr.vtf.

What's has been resolved for me : when i run a map with mat_hdr_level 1, the defaultcubemap.vtf is properly displayed.

With hdr, the default render is odd, so i try to regenerate de hdr from that material, with hdrshop, PFM and Vtex, but i doubt my cubemapdefault.hdr.vtf, is added in both ( "../sourcemods/mymod/materials/engine/" and "../common/source sdk base 2013 singleplayer/plateform/materials/engine/") and i always gets this very bright effect on the materials.

ldr-hdr-buildcubemap

ghost avatar Aug 04 '13 18:08 ghost

Hmm, interesting. I looked at my backed up gcfs to see if there was ever cubemapdefault.hdr.vtf, but I could not seem to find one. But it would make sense that of the cubemaps not building because there is no file to override the default black with.

reepblue avatar Aug 04 '13 19:08 reepblue

engine/defaultcubemap.hdr.vtf doesn't exist because it's not referenced by the engine.

saul avatar Aug 04 '13 20:08 saul