Stencil not appearing in Stencil Texture Paint mode in Blender 2.8 on Mac OS #59722

Closed
opened 2018-12-21 15:23:31 +01:00 by Harry Boteler · 24 comments

System Information
Operating system: Mac OS Mojave v10.14.2
Graphics card: Radeon Pro 580 8192 MB

Blender Version
Broken: Stencil painting
2.80 Beta, 2018-12-20
(example: 2.80, edbf15d3c0, blender2.8, 2018-11-28, as found on the splash screen)
Worked: (optional)

Short description of error
Stencil not appearing when Mapping is in Stencil mode; other Mappings, e.g. tile work ok
Exact steps for others to reproduce the error
Based on the default startup or an attached .blend file (as simple as possible).

**System Information** Operating system: Mac OS Mojave v10.14.2 Graphics card: Radeon Pro 580 8192 MB **Blender Version** Broken: Stencil painting 2.80 Beta, 2018-12-20 (example: 2.80, edbf15d3c044, blender2.8, 2018-11-28, as found on the splash screen) Worked: (optional) **Short description of error** Stencil not appearing when Mapping is in Stencil mode; other Mappings, e.g. tile work ok **Exact steps for others to reproduce the error** Based on the default startup or an attached .blend file (as simple as possible).
Author

Added subscriber: @hboteler

Added subscriber: @hboteler
Author

In Texture Paint mode, the background texture does not appear when Mapping is in Stencil mode; all the other Mappings, however, such as 'tiled' and 'random' work ok. I have reported this in blender.stackexchange and was advised to report it here as a bug report.

In Texture Paint mode, the background texture does not appear when Mapping is in Stencil mode; all the other Mappings, however, such as 'tiled' and 'random' work ok. I have reported this in blender.stackexchange and was advised to report it here as a bug report.

Added subscriber: @ZedDB

Added subscriber: @ZedDB

I can sort of reproduce this on my end. The stencil texture is not repeated across the screen but it is just the full texture stuck at the bottom left of the screen. The offset and scale doesn't seem to make the area any bigger.

I can sort of reproduce this on my end. The stencil texture is not repeated across the screen but it is just the full texture stuck at the bottom left of the screen. The offset and scale doesn't seem to make the area any bigger.

Added subscriber: @brecht

Added subscriber: @brecht

Please attach a .blend file to demonstrate the problem.

Please attach a .blend file to demonstrate the problem.

Never mind, that was how it is supposed to work...

I can not reproduce this on my end then.
Do you use any specific textures?

Does it work if you reset to factory defaults?

Never mind, that was how it is supposed to work... I can not reproduce this on my end then. Do you use any specific textures? Does it work if you reset to factory defaults?
Author

I attach the .blend file that was a follow-along to Jayanam's Youtube tutorial 'Blender 2.8: Eevee & Texture Paint' (1 Nov 2018).
Texture Paint & Stencil Cube.blend

I attach the .blend file that was a follow-along to Jayanam's Youtube tutorial 'Blender 2.8: Eevee & Texture Paint' (1 Nov 2018). [Texture Paint & Stencil Cube.blend](https://archive.blender.org/developer/F6027205/Texture_Paint___Stencil_Cube.blend)

There is no texture set up in this file that I can see, and the Overlays panel has display of textures disabled.

Do you have a .blend file that is fully set up to show the texture, but then doesn't show it? Otherwise it's difficult to tell if it's a setup problem, or maybe some problem specific to macOS or you graphics card.

There is no texture set up in this file that I can see, and the Overlays panel has display of textures disabled. Do you have a .blend file that is fully set up to show the texture, but then doesn't show it? Otherwise it's difficult to tell if it's a setup problem, or maybe some problem specific to macOS or you graphics card.
Author

Sorry, last Blend file was not up to date so I include another with texture packed. I have just downloaded and tried out the latest Mac OS build and have been able to try this file out on two different iMacs, with different results. On the most recent one (stats provided above) the same problem persists: I can paint with all Mappings except Stencil, and the background image does not appear. However, on the older iMac, I can paint in Stencil mode, although I still can't get the actual background image to appear. This older iMac (mid-2011) is operating on High Sierra 10-13-6 with an AMD Radeon HD 6970M 2048 MB Graphics card. Do you think there might be a problem with the new Mojave OS? Texture Paint Cube4.blend

Sorry, last Blend file was not up to date so I include another with texture packed. I have just downloaded and tried out the latest Mac OS build and have been able to try this file out on two different iMacs, with different results. On the most recent one (stats provided above) the same problem persists: I can paint with all Mappings except Stencil, and the background image does not appear. However, on the older iMac, I can paint in Stencil mode, although I still can't get the actual background image to appear. This older iMac (mid-2011) is operating on High Sierra 10-13-6 with an AMD Radeon HD 6970M 2048 MB Graphics card. Do you think there might be a problem with the new Mojave OS? [Texture Paint Cube4.blend](https://archive.blender.org/developer/F6034234/Texture_Paint_Cube4.blend)
Author

Further experimentation with the new iMac on Mojave: using the same file above (Texture Paint Cube4), I moved the cube down to the bottom left corner of the viewport and now I can see the stencil painting working, although as with on the other iMac, the background image is not visible so I am unable to position it - I admit this might be something I'm not doing but can't see what.

Further experimentation with the new iMac on Mojave: using the same file above (Texture Paint Cube4), I moved the cube down to the bottom left corner of the viewport and now I can see the stencil painting working, although as with on the other iMac, the background image is not visible so I am unable to position it - I admit this might be something I'm not doing but can't see what.
Clément Foucault was assigned by Sebastian Parborg 2018-12-22 16:08:43 +01:00

That file seems to work flawlessly on my linux machine:
Skärmbild_2018-12-22_16-03-59.png

So I'm guessing this is mac related.

Could you run blender with --debug-gpu and then attach the output here (after you have tried to get the stencil to appear).

You could also try --debug-gpu-force-workarounds and see if that help.

That file seems to work flawlessly on my linux machine: ![Skärmbild_2018-12-22_16-03-59.png](https://archive.blender.org/developer/F6035841/Skärmbild_2018-12-22_16-03-59.png) So I'm guessing this is mac related. Could you run blender with `--debug-gpu` and then attach the output here (after you have tried to get the stencil to appear). You could also try `--debug-gpu-force-workarounds` and see if that help.
Author

Sorry, but I am guessing this has something to do with running scripts, which as yet I'm totally unfamiliar with - only started using Blender (2.7) this Autumn! I can do it if you guide me through the steps... otherwise might be quicker to get someone else to try it out!

Sorry, but I am guessing this has something to do with running scripts, which as yet I'm totally unfamiliar with - only started using Blender (2.7) this Autumn! I can do it if you guide me through the steps... otherwise might be quicker to get someone else to try it out!

Those are terminal options you append when starting blender.

So open up a terminal and navigate to where you have the blender binary and run ./blender --debug-gpu > output. The output will now be saved to the file output in that directory.

Those are terminal options you append when starting blender. So open up a terminal and navigate to where you have the blender binary and run `./blender --debug-gpu > output`. The output will now be saved to the file `output` in that directory.
Author

Che?? Don't even know what a 'terminal option' is, but I've noticed you've assigned this task to Clément Foucault, so I'm keeping my fingers crossed and relying on him! Sorry to be such a pain!

Che?? Don't even know what a 'terminal option' is, but I've noticed you've assigned this task to Clément Foucault, so I'm keeping my fingers crossed and relying on him! Sorry to be such a pain!

He will want this output too.
Here is a guide how to use the terminal: https://macpaw.com/how-to/use-terminal-on-mac

He will want this output too. Here is a guide how to use the terminal: https://macpaw.com/how-to/use-terminal-on-mac
Author

Still out of my depth here. Can navigate to the file using Terminal (I presume you mean my project file 'Texture Paint Cube4.blend' when you say 'binary file'?), but getting 'Permisssion denied' when typing in either '--debug-gpu' or './blender --debug-gpu > output'

Still out of my depth here. Can navigate to the file using Terminal (I presume you mean my project file 'Texture Paint Cube4.blend' when you say 'binary file'?), but getting 'Permisssion denied' when typing in either '--debug-gpu' or './blender --debug-gpu > output'

I meant that you should start blender via the terminal. blender binary == blender program.

How to start blender via the terminal is explained in the first part here: https://blender.stackexchange.com/questions/2078/how-to-use-blender-command-lines-in-osx

I meant that you should start blender via the terminal. blender binary == blender program. How to start blender via the terminal is explained in the first part here: https://blender.stackexchange.com/questions/2078/how-to-use-blender-command-lines-in-osx

Added subscriber: @lancelet

Added subscriber: @lancelet

Patch for this:

diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 6a2a374f87d..75324f46cc6 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -692,7 +692,7 @@ static void paint_draw_tex_overlay(
                }

                /* draw textured quad */
-               immUniform1i("image", GL_TEXTURE0);
+               immUniform1i("image", 0);

                immBegin(GPU_PRIM_TRI_FAN, 4);
                immAttr2f(texCoord, 0.0f, 0.0f);

Root cause: AFAICT, GL_TEXTURE0 is a GLenum, and not an integer index. When setting the uniform variable image for the shader, an integer index is required.

See https://www.khronos.org/opengl/wiki/Sampler_(GLSL)#Binding_textures_to_samplers

The value you provide to a sampler uniform is the texture image unit to which you will bind the texture that the sampler will access. This value is a texture image unit index, not the texture object itself and not an OpenGL enumerator.

You can see that immUniform1i is already used with an integer index at source/blender/editors/sculpt_paint/paint_cursor.c line 778.

This is pretty confusing (took me a few days to track it down), but essentially it's a type error.

Edit: you can read my bug-fixing journey for this one on Twitter if you want: https://twitter.com/jmerritt/status/1076113441956360194

Patch for this: ``` diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 6a2a374f87d..75324f46cc6 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -692,7 +692,7 @@ static void paint_draw_tex_overlay( } /* draw textured quad */ - immUniform1i("image", GL_TEXTURE0); + immUniform1i("image", 0); immBegin(GPU_PRIM_TRI_FAN, 4); immAttr2f(texCoord, 0.0f, 0.0f); ``` Root cause: AFAICT, `GL_TEXTURE0` is a `GLenum`, and not an integer index. When setting the uniform variable `image` for the shader, an integer index is required. See https://www.khronos.org/opengl/wiki/Sampler_(GLSL)#Binding_textures_to_samplers > The value you provide to a sampler uniform is the texture image unit to which you will bind the texture that the sampler will access. This value is a texture image unit index, not the texture object itself and not an OpenGL enumerator. You can see that `immUniform1i` is already used with an integer index at `source/blender/editors/sculpt_paint/paint_cursor.c` line 778. This is pretty confusing (took me a few days to track it down), but essentially it's a type error. Edit: you can read my bug-fixing journey for this one on Twitter if you want: https://twitter.com/jmerritt/status/1076113441956360194

This issue was referenced by 410142caff

This issue was referenced by 410142caffd1df20463925251f4925d5f105f23d

@lancelet, thanks for finding this!

@lancelet, thanks for finding this!

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author

Yes, my thanks too! I looked at your 'bug-fixing journey' on Twitter and appreciate the effort it took!

Yes, my thanks too! I looked at your 'bug-fixing journey' on Twitter and appreciate the effort it took!
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#59722
No description provided.