Skip to content

Commit

Permalink
Fix voxels on linux firefox (#4756)
Browse files Browse the repository at this point in the history
* fix linux-firefox problem

* update changelog
  • Loading branch information
ffreyer authored Jan 27, 2025
1 parent 5a3c575 commit 53a71a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Added a tutorial on creating an inset plot [#4697](https://github.com/MakieOrg/Makie.jl/pull/4697)
- Enhanced Pattern support: Added general CairoMakie implementation, improved quality, added anchoring, added support in band, density, added tests & fixed various bugs and inconsistencies. [#4715](https://github.com/MakieOrg/Makie.jl/pull/4715)
- Fixed issue with `voronoiplot` for Voronoi tessellations with empty polygons [#4740](https://github.com/MakieOrg/Makie.jl/pull/4740)
- Fixed issue with `WGLMakie.voxels` not rendering on linux with firefox [#4756](https://github.com/MakieOrg/Makie.jl/pull/4756)

## [0.22.1] - 2025-01-17

Expand Down
6 changes: 4 additions & 2 deletions WGLMakie/assets/voxel.vert
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ const mat2x3 orientations[3] = mat2x3[](
);

void main() {
get_dummy(); // otherwise this doesn't render :)
// Without fetching the instanced data the shader wont render. On some
// systems (linux + firefox for example) this even needs to be used.
float zero = get_dummy();

/* How this works:
To simplify lets consider a 2d grid of pixel where the voxel surface would
Expand Down Expand Up @@ -66,7 +68,7 @@ void main() {
// Map instance id to dimension and index along dimension (0..N+1 or 0..2N)
ivec3 size = textureSize(voxel_id, 0);
int dim, id = gl_InstanceID, front = 1;
float gap = get_gap();
float gap = get_gap() + zero;
if (gap > 0.01) {
front = 1 - 2 * int(gl_InstanceID & 1);
if (id < 2 * size.z) {
Expand Down

0 comments on commit 53a71a1

Please sign in to comment.