BI: Washed out vertex color from material node #45737

Closed
opened 2015-08-09 05:22:31 +02:00 by WK Bong · 9 comments

System Information
Win 10 64 bit, Ubuntu, Linux Mint; GTX 560ti, GTX 680, GTX 970

Blender Version
Broken: 2.75a

Short description of error
IceCreamSandwichBugF.jpg
Vertex color is watched out if previewed and rendered from geometry node in BI.
The vertex color should behave similar to a shadeless material node with vertex color paint turned ON.
Note: Problem confirmed by few artists.

Exact steps for others to reproduce the error
Open file, plug either material node or geometry node to output node.
Blend File: IceCreamSandwichBug.blend

PS: Please enjoy the ice cream sandwich :D

**System Information** Win 10 64 bit, Ubuntu, Linux Mint; GTX 560ti, GTX 680, GTX 970 **Blender Version** Broken: 2.75a **Short description of error** ![IceCreamSandwichBugF.jpg](https://archive.blender.org/developer/F222125/IceCreamSandwichBugF.jpg) Vertex color is watched out if previewed and rendered from geometry node in BI. The vertex color should behave similar to a shadeless material node with vertex color paint turned ON. **Note**: Problem confirmed by few artists. **Exact steps for others to reproduce the error** Open file, plug either *material node* or *geometry node* to output node. **Blend File:** [IceCreamSandwichBug.blend](https://archive.blender.org/developer/F222131/IceCreamSandwichBug.blend) **PS:** Please enjoy the ice cream sandwich :D
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @WeeKwongBong

Added subscriber: @WeeKwongBong

Added subscriber: @Sergey

Added subscriber: @Sergey

This is most likely a missing vertex color linearization issue in the render pipeline. Will have a look later.

This is most likely a missing vertex color linearization issue in the render pipeline. Will have a look later.

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Checked on a fix.

The issue is caused by vertex color being sRGB but its treated as linear in areas.

  • Blender Internal Render (washed out)
  • GLSL view (washed out)
  • Multitexture (OK)

The patch fixes the 2x washed out cases, so they both match multi-texture view.
P252: Fix for #45737

diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 54864b2..311fcb8 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -149,6 +149,7 @@ void geom(vec3 co, vec3 nor, mat4 viewinvmat, vec3 attorco, vec2 attuv, vec4 att
 	uv_attribute(attuv, uv);
 	normal = -normalize(nor);	/* blender render normal is negated */
 	vcol_attribute(attvcol, vcol);
+	srgb_to_linearrgb(vcol, vcol);
 	vcol_alpha = attvcol.a;
 	frontback = (gl_FrontFacing)? 1.0: 0.0;
 }
diff --git a/source/blender/nodes/shader/nodes/node_shader_geom.c b/source/blender/nodes/shader/nodes/node_shader_geom.c
index 2fb0353..cd52c4e 100644
--- a/source/blender/nodes/shader/nodes/node_shader_geom.c
+++ b/source/blender/nodes/shader/nodes/node_shader_geom.c
@@ -91,7 +91,7 @@ static void node_shader_exec_geom(void *data, int UNUSED(thread), bNode *node, b
 				}
 			}
 
-			copy_v3_v3(out[GEOM_OUT_VCOL]->vec, scol->col);
+			srgb_to_linearrgb_v3_v3(out[GEOM_OUT_VCOL]->vec, scol->col);
 			out[GEOM_OUT_VCOL]->vec- [x] = scol->col[3];
 			out[GEOM_OUT_VCOL_ALPHA]->vec- [x] = scol->col[3];
 		}

Checked on a fix. The issue is caused by vertex color being sRGB but its treated as linear in areas. - Blender Internal Render (washed out) - GLSL view (washed out) - Multitexture (OK) The patch fixes the 2x washed out cases, so they both match multi-texture view. [P252: Fix for #45737](https://archive.blender.org/developer/P252.txt) ```diff diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index 54864b2..311fcb8 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -149,6 +149,7 @@ void geom(vec3 co, vec3 nor, mat4 viewinvmat, vec3 attorco, vec2 attuv, vec4 att uv_attribute(attuv, uv); normal = -normalize(nor); /* blender render normal is negated */ vcol_attribute(attvcol, vcol); + srgb_to_linearrgb(vcol, vcol); vcol_alpha = attvcol.a; frontback = (gl_FrontFacing)? 1.0: 0.0; } diff --git a/source/blender/nodes/shader/nodes/node_shader_geom.c b/source/blender/nodes/shader/nodes/node_shader_geom.c index 2fb0353..cd52c4e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_geom.c +++ b/source/blender/nodes/shader/nodes/node_shader_geom.c @@ -91,7 +91,7 @@ static void node_shader_exec_geom(void *data, int UNUSED(thread), bNode *node, b } } - copy_v3_v3(out[GEOM_OUT_VCOL]->vec, scol->col); + srgb_to_linearrgb_v3_v3(out[GEOM_OUT_VCOL]->vec, scol->col); out[GEOM_OUT_VCOL]->vec- [x] = scol->col[3]; out[GEOM_OUT_VCOL_ALPHA]->vec- [x] = scol->col[3]; } ```

@ideasman42, patch LGTM.

@ideasman42, patch LGTM.
Campbell Barton was assigned by Sergey Sharybin 2015-08-24 15:21:14 +02:00

This issue was referenced by 3633499f4e

This issue was referenced by 3633499f4ea93ad3313afd19a122c5e04b59b066

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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
4 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#45737
No description provided.