Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BREAKING] Refactor API for gammaCorrection, toneMapping and Fog settings #7101

Merged
merged 4 commits into from
Nov 14, 2024

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Nov 11, 2024

Breaking changes:

gammaCorrection and toneMapping

Before, those were properties of the scene.rendering:

Scene.rendering.gammaCorrection
Scene.rendering.toneMapping

But these are now per camera:

CameraComponent.gammaCorrection
CameraComponent.toneMapping

example

 cameraEntity.addComponent('camera', {
    toneMapping: pc.TONEMAP_ACES
});

Fog parameters

Before, those were properties of the scene.rendering:

Scene.rendering.fog // fog type
Scene.rendering.fogColor, fogStart, fogEnd, fogDensity

Now these are in its dedicated FogParams module, available on the Scene:

Scene.fog.type
Scene.fog.color, start, end, density

The fog can be also overriden on the CameraComponent, where FogParams instance can be assigned:

CameraComponent.fog = new ForParams();
CameraComponent.fog.type = ..;
CameraComponent.fog.start = ..;

Other changes

  • RenderParams class has been removed, and instead:
  • new private CameraShaderParams class has been created. This is used to pass all camera related rendering properties to shader generation / used to pick the appropriate shader.

@mvaligursky mvaligursky self-assigned this Nov 11, 2024
@mvaligursky mvaligursky added area: graphics Graphics related issue enhancement labels Nov 11, 2024
@mvaligursky mvaligursky merged commit a611fe2 into main Nov 14, 2024
8 checks passed
@mvaligursky mvaligursky deleted the mv-renderparams-refactor branch November 14, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants