Skip to content

Added a checkbox for bilinear filtering of color and altitude - #17

Open
SudoMike wants to merge 1 commit into
s-macke:masterfrom
SudoMike:bilinear_filtering
Open

Added a checkbox for bilinear filtering of color and altitude#17
SudoMike wants to merge 1 commit into
s-macke:masterfrom
SudoMike:bilinear_filtering

Conversation

@SudoMike

Copy link
Copy Markdown

Bilinear filtering makes hills look smoother, but it makes intentionally-angular things like the pyramids in the example maps look weird.

Bilinear filtering makes hills look smoother, but it makes intentionally-angular things like the pyramids in the example maps look weird.
Comment thread VoxelSpace.html
var b2 = b & 0xFF;

var invt = 1.0 - t;
return 0xFF000000 |

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performance could probably could be improved on by using fixed point math here, depending on what the JIT compiler does.

Comment thread VoxelSpace.html
// between those to get the final color.
var upper_color = ColorInterp(map.color[ulindex], map.color[urindex], plxt);
var lower_color = ColorInterp(map.color[llindex], map.color[lrindex], plxt);
final_color = ColorInterp(lower_color, upper_color, plyt);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perf improvement opportunity (probably minor): decompose the 4 corners from uint32's into RGB values ahead of time (better yet, make map.color already store separate R, G, and B values), do the bilinear filtering, and then recompose only at the end. This would save recomposing upper_color and lower_color into uint32's, then immediately decomposing them again.

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.

1 participant