Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions docs/Graphics/Graphics-General/ParallaxCorrectedCubemaps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: Parallax Corrected Cubemaps
---
# Parallax Corrected Cubemaps

![Click on the hand holding a mask](images/guide_parallax_cubemaps.jpg)

This page covers Strata's implementation of Parallax-Corrected Cubemaps. These cubemaps are created with a combination of the `env_cubemap` point entity and the `parallax_obb` brush entity.

## Overview
This tutorial is from the [Momentum Mod Wiki](https://docs.momentum-mod.org/shaders/parallax_corrected_cubemaps/).

> [!NOTE]
> Thanks to Brian Charles for his work on this feature.
> More technical information can be found on the [Valve Developer Wiki Page.](https://developer.valvesoftware.com/wiki/Parallax_Corrected_Cubemaps)

## Prerequisites
* Be proficient in using the Hammer Editor
* Have the appropriate `.fgd` file for your game in your Hammer configuration
* Know how to use the developer console
## Components of a Parallax-Corrected Cubemap

In Hammer, Parallax-Corrected Cubemaps need two entities to function correctly:

* A trigger brush tied to a parallax_obb entity - must be named

* An env_cubemap with “Cubemap Bounds” set to the name of the parallax_obb

![Click on the hand holding a mask](images/cube_0.jpg)

> [!NOTE]
> In older versions of Momentum Mod, you may notice a box appear in the centre of the brush when you tie it to a parallax_obb entity like shown above.
> This is normal and allows you to more easily select the brush if you have made it match the shape of the room.

Any regular LightmappedGeneric materials will still be able to use the cubemap as normal, this feature simply adds functionality on top of the existing env_cubemap in conjunction with an extra entity and shader to use inside .VMT files.

> [!TIP]
> There are some important things to take note of:
> * The parallax_obb entity must be a single box brush
> * The Parallax-Corrected cubemap is still built the same way regular cubemaps are. This means that you may have distortion in the reflections depending on where you place the env_cubemap and the shape of the parallax_obb brush.
>
> This example has a wide room with a low ceiling as well as the cubemap entity not quite in the centre:

![Click on the hand holding a mask](images/cube_4.jpg)

## Hammer
Here is the process of creating the necessary entities in Hammer for this feature to work in a room you’ve already made.

The first thing you should do is to create the “bounding box” of the cubemap with a trigger brush. Make it so that it fits the room as closely as possible.
![Click on the hand holding a mask](images/cube_2.jpg)

Once you’ve made the trigger brush, tie it to a parallax_obb entity and give it a name:

![Click on the hand holding a mask](images/cube_3.png)

That’s all that is needed for the brush, onto the cubemap entity itself.

When creating an env_cubemap you should see an extra option called “Cubemap Bounds”. Set it to the name of the parallax_obb you just created.

![Click on the hand holding a mask](images/cube_1.png)

This should be all the setup that is required in Hammer.

You should be able to compile your map as normal and build the cubemaps in game to see the effects if you have any supported materials in the map.


Binary file added docs/Graphics/Graphics-General/images/cube_0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Graphics/Graphics-General/images/cube_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Graphics/Graphics-General/images/cube_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Graphics/Graphics-General/images/cube_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Graphics/Graphics-General/images/cube_4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/Graphics/Graphics-General/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"title": "Parallax Corrected Cubemaps",
"weight": 20
}
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions docs/Graphics/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"title": "Graphics & Lighting"
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ There are 3 KeyValues in `light_rt` and `light_rt_spot` entities: `Volumetric Li

`env_projectexture`, has only two volumetric-related KeyValues - `Volumetric Intensity`, which is identical to `Volumetric Density`, and `Enable Volumetrics`. But unlike all the other entities that produce volumetrics, projected texture volumetrics also support projecting .webm videos.

More about setting up volumetrics for each entity in [Quick Start](/lighting/volumetrics/quick_setup)
More about setting up volumetrics for each entity in [Quick Start](/Graphics/volumetrics/quick_setup)

## Light Cookies and WebM support

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This is a list of currently known issues and some troubleshooting tips for any i

### "The volumetrics for a light source are everywhere, even behind walls!"

* Volumetric lighting is shadow dependant, you need to make sure the `Shadowed` flag is checked when making shadowed volumetrics. If the flag is enabled but volumetrics are still leaking, then you might have too many dynamic shadows updating at once. See [clustered troubleshooting page](/lighting/clustered/troubleshooting) for more information related to the issue.
* Volumetric lighting is shadow dependant, you need to make sure the `Shadowed` flag is checked when making shadowed volumetrics. If the flag is enabled but volumetrics are still leaking, then you might have too many dynamic shadows updating at once. See [clustered troubleshooting page](/Graphics/clustered/troubleshooting) for more information related to the issue.

### "My volumetrics are broken and corrupt!"

Expand Down
3 changes: 0 additions & 3 deletions docs/lighting/meta.json

This file was deleted.

2 changes: 1 addition & 1 deletion docs/modding/devui/categories/graphics.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The graphics tab is the most popular among all the other tab in the Developer UI

![Graphics tab](images/graphics.png)

It consists of six windows - **Fog Config**, **[Clustered Light Inspector](/lighting/clustered/clustered_light_inspector)**, **Clustered Volumetrics Inspector**, **CSM Config**, **Post Processing** and **SoftBody Debug**.
It consists of six windows - **Fog Config**, **[Clustered Light Inspector](/Graphics/clustered/clustered_light_inspector)**, **Clustered Volumetrics Inspector**, **CSM Config**, **Post Processing** and **SoftBody Debug**.

****

Expand Down