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

Colored fog rendering #1

Open
kosua20 opened this issue Jan 8, 2019 · 4 comments
Open

Colored fog rendering #1

kosua20 opened this issue Jan 8, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@kosua20
Copy link
Owner

kosua20 commented Jan 8, 2019

Each age is supposed to be associated with a background color used for the fog. For now I'm only providing a color picker, as I was not able to find where this info is stored in the assets files / accessible through the API. Finding it and using it would help get closer to the in-game rendering.

@kosua20 kosua20 added the enhancement New feature or request label Jan 8, 2019
@Deledrius
Copy link

Deledrius commented Jan 8, 2019

The fog settings and color are stored in the Age's .fni file. They are literally a series of commands that are sent to the internal command parser and executed.

A common example is the city.fni which shows the usual settings for the Cavern:

Graphics.Renderer.Setyon 100000
Graphics.Renderer.Fog.SetDefLinear -1500 20000 1
Graphics.Renderer.Fog.SetDefColor .4 .3 .1
Graphics.Renderer.SetClearColor .4 .3 .1

The colors are float RGBs. You can look up these commands in the in-console help for more information on their parameters.

@kosua20
Copy link
Owner Author

kosua20 commented Jan 9, 2019

Thank you very much! I had started to look at plFogEnvironment: it didn't seem to be loaded from the age/prp files, but I missed the fact that this was set up this way. I'll look into it!

@dpogue
Copy link

dpogue commented Jan 10, 2019

So plFogEnvironment is actually used to handle the fog settings at runtime, but the way it ends up working is that there's a single plFogEnvironment that exists for the pipeline and all objects use that fog. It actually works if you create plFogEnvironments and put them in the PRP files (although no artist-oriented tools, including Cyan's, allow this).

As for how we ended up in this situation...

The current fog system sucks. It was never meant to get used this way, but the production artists started using it with debug commands that were around, and before they could be stopped it was too late.
~ plDXPipeline.cpp, line 4320

@kosua20
Copy link
Owner Author

kosua20 commented Jan 10, 2019

Thank you again, this is much clearer now and I should be able to apply this to PRPViewer easily. I would also like to use this as an opportunity to thank you and all the H-uru contributors! I couldn't have done this without libhsplasma.

kosua20 added a commit that referenced this issue Jan 13, 2019
As described in #1, the fog parameters can be parsed from the fni file, and apply to the scene.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants