Confusing units in displacement modifier parameters #33781

Closed
opened 2013-01-06 10:17:19 +01:00 by Maxim Vasiliev · 6 comments

%%%--- Blender version with error, and version that worked ---
2.65.5

- Short description of error ---

When using non-default scene units and/or scale
Option "strength" remains unitless
Option "midlevel" becomes midlevel * base unit.

In fact, according to sources, offset is calculated as:
(texres.tin - midlevel) * strength
The midlevel is applied to texture value, which is normalized to range [0;1] - midlevel expected to be also normalized
The strength is scale that maps range [0;1] to scene units - strength expected to be unit-oriented (and probably named "scale")

- Steps for others to reproduce the error (preferably based on attached .blend file) ---

Create grayscale PNG image with 16bit values from 0 to 65535.
Create image texture, load the image as "non-color" colorspace.
Create grid.
Create displacement modifier with the texture on the grid.
Set midlevel to 0.5 and strength 2.0 (the grid should become with offset -1U to +1U)

Set scene units=metrics, scale=30 (1U = 30m)
Expected results: midlevel remains 0.5, strength becomes 60m (2U)
Observated: midlevel becomes 15m, strength remains 2.0

%%%

%%%--- Blender version with error, and version that worked --- 2.65.5 - Short description of error --- When using non-default scene units and/or scale Option "strength" remains unitless Option "midlevel" becomes midlevel * base unit. In fact, according to sources, offset is calculated as: (texres.tin - midlevel) * strength The midlevel is applied to texture value, which is normalized to range [0;1] - midlevel expected to be also normalized The strength is scale that maps range [0;1] to scene units - strength expected to be unit-oriented (and probably named "scale") - Steps for others to reproduce the error (preferably based on attached .blend file) --- Create grayscale PNG image with 16bit values from 0 to 65535. Create image texture, load the image as "non-color" colorspace. Create grid. Create displacement modifier with the texture on the grid. Set midlevel to 0.5 and strength 2.0 (the grid should become with offset -1U to +1U) Set scene units=metrics, scale=30 (1U = 30m) Expected results: midlevel remains 0.5, strength becomes 60m (2U) Observated: midlevel becomes 15m, strength remains 2.0 %%%
Author

Changed status to: 'Open'

Changed status to: 'Open'

%%%Checked the displace modifier, it was incorrectly using units for mid-level (fixed in svn r53799).

But there is certainly some odd stuff going on with PNG saving/reloading using different colors.
Assigning to Sergey.%%%

%%%Checked the displace modifier, it was incorrectly using units for mid-level (fixed in svn r53799). But there is certainly some odd stuff going on with PNG saving/reloading using different colors. Assigning to Sergey.%%%

%%%Checking further, this may be an issue in the displace modifier, taking back the bug :)%%%

%%%Checking further, this may be an issue in the displace modifier, taking back the bug :)%%%

%%%Found the problem.

  • Selecting a new image with 0.5 and a float buffer creates the image buffer in linear color space. (ok)
  • Saving the float buffer as a 16bit PNG writes the floats as 16bit unsigned shorts with no rec709->sRGB conversion.
  • Loading the 16bit PNG loads the image as sRGB.

Attached a patch that applies the same logic used when saving Jpeg200 from float buffer.%%%

%%%Found the problem. - Selecting a new image with 0.5 and a float buffer creates the image buffer in linear color space. (ok) - Saving the float buffer as a 16bit PNG writes the floats as 16bit unsigned shorts with no rec709->sRGB conversion. - Loading the 16bit PNG loads the image as sRGB. Attached a patch that applies the same logic used when saving Jpeg200 from float buffer.%%%

%%%fixed r53807.%%%

%%%fixed r53807.%%%

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
2 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#33781
No description provided.