Fix #115460: EEVEE-Next: Missing bind when drawing curves #121064

Open
Jeroen Bakker wants to merge 2 commits from Jeroen-Bakker/blender:eevee/fix/missing-curve-texture-bind into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

When drawing hair/curves the material shader has a "a" texture slot,
but this slot was never bound to a texture. This PR fixes this by
adding a default texture to it and when available tries to bind
CD_AUTO_FROM_NAME resources.

This part seems to be not implemented when the new curve rendering
was added. CD_AUTO_FROM_NAME was never considered and therefore the
layer could not be found, and the sampler could not be found.

On the other hand Curves.active_uvmap is not filled which might or
might not be an issue on data management level and complicated this
fix.

Fixes #115460

When drawing hair/curves the material shader has a "a" texture slot, but this slot was never bound to a texture. This PR fixes this by adding a default texture to it and when available tries to bind CD_AUTO_FROM_NAME resources. This part seems to be not implemented when the new curve rendering was added. `CD_AUTO_FROM_NAME` was never considered and therefore the layer could not be found, and the sampler could not be found. On the other hand `Curves.active_uvmap` is not filled which might or might not be an issue on data management level and complicated this fix. Fixes #115460
Jeroen Bakker added this to the 4.2 LTS milestone 2024-04-25 09:09:39 +02:00
Jeroen Bakker added the
Module
EEVEE & Viewport
label 2024-04-25 09:09:39 +02:00
Jeroen Bakker self-assigned this 2024-04-25 09:09:40 +02:00
Jeroen Bakker added 1 commit 2024-04-25 09:09:47 +02:00
8249711ee1 EEVEE-Next: Fix missing texture bind when drawing curves/hair
When drawing hair/curves the material shader has a "a" texture slot,
but this slot was never bound to a texture. This PR fixes this by
default add a dummy texture to it.
Jeroen Bakker added this to the EEVEE & Viewport project 2024-04-25 09:09:52 +02:00
Jeroen Bakker requested review from Clément Foucault 2024-04-25 09:10:05 +02:00
Jeroen Bakker changed title from EEVEE-Next: Fix missing texture bind when drawing curves/hair to WIP: EEVEE-Next: Fix missing texture bind when drawing curves/hair 2024-04-25 10:02:42 +02:00
Author
Member

Moving to WIP, as it might hide other issues as well.

Moving to WIP, as it might hide other issues as well.
Jeroen Bakker changed title from WIP: EEVEE-Next: Fix missing texture bind when drawing curves/hair to EEVEE-Next: Fix missing texture bind when drawing curves/hair 2024-04-25 12:03:08 +02:00
Jeroen Bakker added 1 commit 2024-04-25 12:03:16 +02:00
Jeroen Bakker changed title from EEVEE-Next: Fix missing texture bind when drawing curves/hair to Fix #115460: EEVEE-Next: Missing texture bind when drawing curves 2024-04-25 12:03:46 +02:00
Jeroen Bakker changed title from Fix #115460: EEVEE-Next: Missing texture bind when drawing curves to Fix #115460: EEVEE-Next: Missing bind when drawing curves 2024-04-25 12:07:29 +02:00

@HooglyBoogly do you have any input on this?

@HooglyBoogly do you have any input on this?
Hans Goudey reviewed 2024-04-26 18:32:17 +02:00
Hans Goudey left a comment
Member

To be honest I don't really understand the context or the need for separate "input name" and "attribute name" variables, or why the API is set up in a way that requires us to store both of them. My instinct is that it's more complicated than it needs to be, but yeah, I'm definitely missing something.

To be honest I don't really understand the context or the need for separate "input name" and "attribute name" variables, or why the API is set up in a way that requires us to store both of them. My instinct is that it's more complicated than it needs to be, but yeah, I'm definitely missing something.
Author
Member

Gpu materials can be shared between multiple objects. Curves but also other geometry. Each object can have an active uvmap that is differently named.

We don’t want to recompile the shaders based on the geometry. So this pr introduces a mapping system.

This is specific for hair as mapping attributes for meshes is part of the vbo api (aliasing).

For hair we have a refine shader that can create texture buffers. We also don’t want to generate too much texture buffers when the active uvmap is also accessed by name in the same shader.

I am open for other solutions as well. I do thing when the curves.active_uvmap is available we can reduce some lookups during this process. But I am not sure if that attribute should be used in this case….

Gpu materials can be shared between multiple objects. Curves but also other geometry. Each object can have an active uvmap that is differently named. We don’t want to recompile the shaders based on the geometry. So this pr introduces a mapping system. This is specific for hair as mapping attributes for meshes is part of the vbo api (aliasing). For hair we have a refine shader that can create texture buffers. We also don’t want to generate too much texture buffers when the active uvmap is also accessed by name in the same shader. I am open for other solutions as well. I do thing when the curves.active_uvmap is available we can reduce some lookups during this process. But I am not sure if that attribute should be used in this case….
Merge conflict checking is in progress. Try again in few moments.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u eevee/fix/missing-curve-texture-bind:Jeroen-Bakker-eevee/fix/missing-curve-texture-bind
git checkout Jeroen-Bakker-eevee/fix/missing-curve-texture-bind
Sign in to join this conversation.
No reviewers
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 Assignees
3 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#121064
No description provided.