Grid is opaque and different scale on macOS #51813

Closed
opened 2017-06-15 08:34:09 +02:00 by Andrei Nadin · 11 comments

System Information
macOS 10.12.6 AMD Radeon R9 M390 2048 MB

Blender Version
Broken: blender-2.80.0-git20170615.f2d7a28a098-x86_64

Downloaded from https://builder.blender.org/download/

All working versions of 2.8 have shown this for me, on 10.12.5 and 10.12.6, In Evee and Clay the grid is an opaque 'floor' and appears to be very large.

Exact steps for others to reproduce the error
Just load the build and observe the cube in the default scene

Blender Render
BI Grid.png

Evee
Evee Grid.png

**System Information** macOS 10.12.6 AMD Radeon R9 M390 2048 MB **Blender Version** Broken: blender-2.80.0-git20170615.f2d7a28a098-x86_64 Downloaded from https://builder.blender.org/download/ All working versions of 2.8 have shown this for me, on 10.12.5 and 10.12.6, In Evee and Clay the grid is an opaque 'floor' and appears to be very large. **Exact steps for others to reproduce the error** Just load the build and observe the cube in the default scene Blender Render ![BI Grid.png](https://archive.blender.org/developer/F631388/BI_Grid.png) Evee ![Evee Grid.png](https://archive.blender.org/developer/F631391/Evee_Grid.png)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @AnadinX

Added subscriber: @AnadinX
Member

Added subscriber: @MikeErwin

Added subscriber: @MikeErwin
Member

Exact same issue on Mac + NVIDIA.

However, Mac + Intel works as intended!

Exact same issue on Mac + NVIDIA. However, Mac + Intel works as intended!

Added subscriber: @fclem

Added subscriber: @fclem

I think this may come from derivative calculation. I use the GLSL function fwidth to compute line thickness and it requires local derivatives. So it may be a driver error or a faulty implementation of derivatives.

I think this may come from derivative calculation. I use the GLSL function fwidth to compute line thickness and it requires local derivatives. So it may be a driver error or a faulty implementation of derivatives.

Added subscriber: @adamlatchem-2

Added subscriber: @adamlatchem-2

581b021a1f
MacOS 10.13.4
NVIDIA GeForce GTX 775M 2048 MB graphics

The grid world positions lie (correctly in my view) in the plane Z=0. This makes the waves collapse to 0. I would think the fix below would also work on other platforms where presumably the grid world position is incorrectly in a plane with Z coordinate much larger than the x,y so has no effect on the clamping.

index baf508fd854..b6d764f3043 100644
    - a/source/blender/draw/modes/shaders/object_grid_frag.glsl
+++ b/source/blender/draw/modes/shaders/object_grid_frag.glsl
@@ -42,7 +42,7 @@ float get_grid(vec3 co, vec3 fwidthCos, float grid_size)
  grid_domain /= fwidthCos;
 
  /* collapse waves and normalize */
- grid_domain.x = min(grid_domain.x, min(grid_domain.y, grid_domain.z)) / grid_size;
+       grid_domain.x = min(grid_domain.x, grid_domain.y) / grid_size;
 
  return 1.0 - smoothstep(0.0, GRID_LINE_SMOOTH / grid_size, grid_domain.x);
 }```

With the above patch I see the following infinite grid rather than no grid and half occluded cube:

![Screen Shot 2018-05-26 at 12.29.36.png](https://archive.blender.org/developer/F3465995/Screen_Shot_2018-05-26_at_12.29.36.png)
581b021a1f1e987df66a659683cfc057f51dc204 MacOS 10.13.4 NVIDIA GeForce GTX 775M 2048 MB graphics The grid world positions lie (correctly in my view) in the plane Z=0. This makes the waves collapse to 0. I would think the fix below would also work on other platforms where presumably the grid world position is incorrectly in a plane with Z coordinate much larger than the x,y so has no effect on the clamping. ```diff --git a/source/blender/draw/modes/shaders/object_grid_frag.glsl b/source/blender/draw/modes/shaders/object_grid_frag.glsl index baf508fd854..b6d764f3043 100644 - a/source/blender/draw/modes/shaders/object_grid_frag.glsl +++ b/source/blender/draw/modes/shaders/object_grid_frag.glsl @@ -42,7 +42,7 @@ float get_grid(vec3 co, vec3 fwidthCos, float grid_size) ``` grid_domain /= fwidthCos; ``` ``` /* collapse waves and normalize */ ``` - grid_domain.x = min(grid_domain.x, min(grid_domain.y, grid_domain.z)) / grid_size; + grid_domain.x = min(grid_domain.x, grid_domain.y) / grid_size; ``` return 1.0 - smoothstep(0.0, GRID_LINE_SMOOTH / grid_size, grid_domain.x); ``` }``` With the above patch I see the following infinite grid rather than no grid and half occluded cube: ![Screen Shot 2018-05-26 at 12.29.36.png](https://archive.blender.org/developer/F3465995/Screen_Shot_2018-05-26_at_12.29.36.png)

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Thanks @adamlatchem-2 for finding the problem. I've commited a more general fix to this problem. Hopefully it should work on mac now.

Thanks @adamlatchem-2 for finding the problem. I've commited a more general fix to this problem. Hopefully it should work on mac now.

This issue was referenced by 198be6f37b

This issue was referenced by 198be6f37b3ca8d65a026a7aeab7d8db4f3eb25e
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#51813
No description provided.