Skip to content

Conversation

@hdoi5324
Copy link
Contributor

@hdoi5324 hdoi5324 commented Dec 4, 2024

This replaces the water volume PrincipledBSDFShader with a Volume Absorption and Volume Scattering shader to provide a better representation of light attenuation in water. The scattering shader can be updated with Blender 4.3 to use the phase 'Fournier-Forand' which models scattering in an underwater environment (commented out in water.py). The combination of Volume Absorption and Volume Scattering shaders is based on this post https://blender.stackexchange.com/questions/129220/how-to-create-an-underwater-scene-in-cycles

Example image from coral_reef.gin scene
Image_0_0_0048_0

@hdoi5324 hdoi5324 requested a review from araistrick as a code owner December 4, 2024 01:33
@araistrick
Copy link
Collaborator

Thanks for the contribution!

I agree the water shader could use some work.

It seems this PR has gotten tangled with the other changes. would it be possible to cherrypick this out into an isolated branch?

The other thing that would be mildly useful is to make this an additional independent option for the water shader, rather than replacing the original. IE could you create a new file altogether called water_scatter.py or something similar? this would be maximally safe.

@hdoi5324
Copy link
Contributor Author

hdoi5324 commented Jan 2, 2025

I'm struggling with trying to make a separate commit on a branch when using a fork. I can't commit on a branch or the main fork as I don't have any permissions I'll try to delete the whole fork and start again.

Separately, I think it's worth switching from 'Principled Volume Shader' to the combination of 'Volume Absorption' and 'Volume Scattering' so that you can specify density for absorption and scattering separately and you can also take advantage of the scattering models in Blender 4.3 which model scattering in water more accurately. I suppose it depends on whether you want to develop the framework for underwater work.

I'll submit a new PR once I delete my current fork and redo the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants