Refactor: GPv3: Store inverted hardness value #118007

Closed
Falk David wants to merge 3 commits from filedescriptor/blender:fix-gpv3-hardness-issue into main

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

The default hardness was previously 1.0f, but the renderer actually used the inverse (1.0f - hardness). Now we store this value directly. This also matches the default for float attributes (0.0f).

The default hardness was previously 1.0f, but the renderer actually used the inverse (1.0f - hardness). Now we store this value directly. This also matches the default for float attributes (0.0f).
Falk David added 3 commits 2024-02-08 17:45:24 +01:00
a5075fa8e5 Refactor: GPv3: Store inverted hardness value
The default hardness was previously 1.0f, but the renderer actually used the inverse (1.0f - hardness). Now we store this value directly. This also matches the default for float attributes (0.0f).
Falk David requested review from Lukas Tönne 2024-02-08 17:45:46 +01:00
Falk David requested review from Hans Goudey 2024-02-08 17:45:46 +01:00
Falk David added this to the Grease Pencil project 2024-02-08 17:45:51 +01:00
Lukas Tönne requested changes 2024-02-08 17:56:18 +01:00
Lukas Tönne left a comment
Member

If the functionality i would also expect the name to change to "softness".

If the functionality i would also expect the name to change to "softness".
@ -167,3 +167,3 @@
stroke_start_caps.span[stroke_i] = int8_t(gps->caps[0]);
stroke_end_caps.span[stroke_i] = int8_t(gps->caps[1]);
stroke_hardnesses.span[stroke_i] = gps->hardness;
/* The default hardness was previously 1.0f, but the renderer actually used the inverse (1 -
Member

References to "previously" and "now" tend to get confusing. Better say "Grease Pencil v2" explicitly.

References to "previously" and "now" tend to get confusing. Better say "Grease Pencil v2" explicitly.
Author
Member

@LukasTonne and I talked about the naming and we agree that if we change it to be inverted, we should change the name in the code to softness too. Otherwise it would get too confusing.

@LukasTonne and I talked about the naming and we agree that if we change it to be inverted, we should change the name in the code to `softness` too. Otherwise it would get too confusing.
Hans Goudey approved these changes 2024-02-08 18:09:34 +01:00
Hans Goudey left a comment
Member

Looks good, I don't think more review is necessary. Agreed that switching the name and variable names to "softness" would be helpful too. And looks like fb6324bdd0 can be reverted too.

Looks good, I don't think more review is necessary. Agreed that switching the name and variable names to "softness" would be helpful too. And looks like fb6324bdd01868a62924e7bb6fecf7ba57c5ba42 can be reverted too.
Author
Member

Since the plan changed to go back to the current renderer, closing this for now.

Since the plan changed to go back to the current renderer, closing this for now.
Falk David closed this pull request 2024-03-04 12:37:03 +01:00
Member

I think this is still worth doing. It will get harder after the initial release because of versioning.
It would only be a 1.0f - softness in the drawing extraction code for now anyway.

I think this is still worth doing. It will get harder after the initial release because of versioning. It would only be a 1.0f - softness in the drawing extraction code for now anyway.

Pull request closed

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 project
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#118007
No description provided.