Garry's Mod

Garry's Mod

32 个评价
CMST: Cubemap switcher or Responsive cubemaps
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 工具
插件标签: 建筑, 风景
文件大小
发表于
更新日期
17.786 KB
2022 年 12 月 14 日 上午 11:22
2022 年 12 月 22 日 上午 7:49
4 项改动说明 ( 查看 )

订阅以下载
CMST: Cubemap switcher or Responsive cubemaps

描述
Requires Referenced map files listener addon to work!


MAP BSP MUST BE INSTALLED IN ORDER FOR THIS TO WORK
(IN OTHER WORDS: MAP BSP MUST BE IN YOUR MAPS FOLDER)



What is this?

Cubemap switcher is an addon that allows you to create function for your map, that dynamically switches cubemaps then light entities toggle on and off.
This is a tool for map makers.

How to use it?

You can follow in-game guide by typing "cubemap_switcher_help" into console or follow a guide below
Before you continue, see method below this one and choose the best from these for your map.

Method 1

To begin, start new game on your map, then..
Step 1: Turn off all the lights.
You must turn off all switchable lights on your map, use 'cubemap_switcher_turnlights 0' to do this
Step 2: Bake unlit cubemaps.
Bake your cubemaps now, use 'buildcubemaps'
Step 3: Extract unlit cubemaps.
Extract your cubemaps, use 'cubemap_switcher_writecubemaps' and follow instructions written in the chat after it finishes extraction. Your game mast be un-paused.
Step 4: Bake default cubemaps.
Restart the map, then turn on all switchable lights on your map, use 'cubemap_switcher_turnlights 1' to do this. Then bake cubemaps, use 'buildcubemaps'.
Step 5: Get the function.
Restart the map again and then use 'cubemap_switcher_getfunction'(you can add 1 as an argument here if you're sure the map you're working on is going to be played only then CMST installed, otherwise, if you'll leave this argument blank, you'll get a standalone function*) and follow instructions written in the chat after it finishes.
Don't forget to restart your game after all this.
After you've done everything, your map will NOT require this addon to be installed and required addon for this addon*.

"Props still shine like sun then lights turn off"

Unfortunately, CMST can't change envmap lightning on props and other non-brush entities. BUT... you can use next method to kinda get around this restriction.

Method 2

In this method you'll need to bake cubemaps(for your final map, not the function) while all lights are turned off.
The game will render unlit cubemaps on all props and other non-brush entities.

If your cubemaps aren't already baked with all lights turned on(They most likely are baked lit so skip this maybe) then..
Step 1: Turn on all the lights.
You must turn on all switchable lights on your map, use 'cubemap_switcher_turnlights 1' to do this
Step 2: Bake lit cubemaps.
Bake your cubemaps now, use 'buildcubemaps'
Else skip these steps..

Step 3: Extract lit cubemaps.
Extract your cubemaps, use 'cubemap_switcher_writecubemaps' and follow instructions written in the chat after it finishes extraction. Your game mast be un-paused.

Step 4: Turn off all the lights.
Restart the map(If followed steps 1-2), then you must turn off all switchable lights on your map, use 'cubemap_switcher_turnlights 0' to do this
Step 5: Bake unlit cubemaps.
Bake your cubemaps now, use 'buildcubemaps', these must be your map's default cubemaps from now on

Step 6: Get inverted function.
Restart the map again and then use 'cubemap_switcher_getfunction_inverted' and follow instructions written in the chat after it finishes.
After you've done everything, your map will NOT require this addon to be installed and required addon for this addon*.

"Then i turn off lights, the cubemaps located on the other side of the map are changing, but i don't want them to"

You can change the table written in the function and assign some of the materials to another light or remove them from that table completely. You can also try to add another named light near the changing cubemap entity and redo the function(You won't need to follow the first steps in this case, just use 'cubemap_switcher_getfunction_*')

github https://github.com/Zack90-oss/CMST-Cubemap-switcher-or-Responsive-cubemaps

If you still have any questions, you can ask them in the discussions or in the comments
热门讨论 查看全部(1)
4
2022 年 12 月 23 日 上午 5:44
Any questions?
Zac90
18 条留言
Breastie 6 月 2 日 上午 3:27 
Yup this is pretty amazing! I finally got around to figuring this out with a test map and works in a way that I expected. Might use this in some future map, where I can turn all lights on with like a breaker box or something. I attempted incluing this in Calmspaces, but it has too many cubemaps and switches that it seems to not work with the way I made it, and I think I'm just feature complete and done with that one. I'll def try to use and cred this in future maps. I love maps having light switches so this is a very nice detail. :er_heart:
Breastie 2 月 2 日 上午 1:43 
Alright, tysm!
Zac90  [作者] 2 月 2 日 上午 12:21 
were* written
Zac90  [作者] 2 月 2 日 上午 12:20 
Yeah, I found the problem, instructions basically say
"Cubemaps was written into garrysmod/data/+cubemap_switcher/dc_<MAPNAME>"
"Move this folder into *youraddon*/materials/maps/"

I'll fix it later
Breastie 2 月 1 日 下午 4:21 
The console says when it's done and where the vtfs are.
Breastie 2 月 1 日 下午 4:14 
I did find the textures in this folder yeah. I just don't get instructions on what to do with these. I think everything else worked as expected.
Zac90  [作者] 2 月 1 日 下午 1:15 
and also try checking your data folder for "+cubemap_switcher" folder
Zac90  [作者] 2 月 1 日 下午 1:13 
Does it write anything to your console?
Breastie 2 月 1 日 上午 3:31 
Step 3 doesn't write to chat.
Y2K†SilentRei 2024 年 6 月 19 日 下午 1:04 
I don't know how to do it.