Fix refraction and material transitions.#1673
Open
ConsueTerra wants to merge 1 commit intochunky-dev:masterfrom
Open
Fix refraction and material transitions.#1673ConsueTerra wants to merge 1 commit intochunky-dev:masterfrom
ConsueTerra wants to merge 1 commit intochunky-dev:masterfrom
Conversation
Contributor
Author
|
I would suggest changing |
leMaik
reviewed
Mar 4, 2024
Comment on lines
+563
to
+565
| if (currentBlock.refractive) { | ||
| //ray.setCurrentMaterial(currentBlock.waterlogged ? Water.INSTANCE : Air.INSTANCE); | ||
| } |
Member
There was a problem hiding this comment.
Either remove this or comment it alltogether.
Suggested change
| if (currentBlock.refractive) { | |
| //ray.setCurrentMaterial(currentBlock.waterlogged ? Water.INSTANCE : Air.INSTANCE); | |
| } | |
| // if (currentBlock.refractive) { | |
| // ray.setCurrentMaterial(currentBlock.waterlogged ? Water.INSTANCE : Air.INSTANCE); | |
| // } |
leMaik
reviewed
Mar 4, 2024
| distance = 0; | ||
| if (currentBlock.intersect(ray, scene)) { | ||
| if (prevBlock != currentBlock) | ||
| if (prevBlock != currentBlock) { //|| (currentBlock.refractive)) { |
ThatRedox
reviewed
Mar 4, 2024
| int depth = implementation.getDepth(); | ||
|
|
||
| double distance = 0; | ||
| //tread air as a null block depending on octreetype and were we are in the trace |
Member
There was a problem hiding this comment.
Suggested change
| //tread air as a null block depending on octreetype and were we are in the trace | |
| // Treat air as a null block depending on octreetype and were we are in the trace |
2d41b57 to
2c076c8
Compare
2c076c8 to
ee0b2c6
Compare
Member
|
Given that #1830 seems to replace this PR, I'd like to maybe merge this into 2.5.0 but not 2.6.0? 🤔 @Peregrine05 and @ConsueTerra, what do you think? What's the difference between the fixes in #1830 (which I still refuse to figure out due to the vast amount of unrelated commits) and this PR? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #1515, in a way that is less hacky than #1601 by defining octree type and modifying the intersection logic based on which octree we are in. Also recovers total internal reflections. This is because Air has different contexts depending on location. Current changes fix solid block refractions, and partially addresses sub block refractions like glass panes. Currently I cant figure out a good methodology for fixing glass panes that does not break intersection logic. Additionally there are quite a few edge cases to consider like partially water logged glass panes.
Now this makes for some weird views, dont know if these are correct but the above tests makes it seems so, in any case that is a function of refraction and Fresnel code than intersection code

Glass panes are still wrong example:
