Specular material hardness influence for texture maps not working correctly or at all with certain specular types #37653

Closed
opened 2013-11-28 19:16:38 +01:00 by Chris Smith · 18 comments

System Information
windows 8

amd hd 7950

Blender Version
2.69

Short description of error
Texture maps set to influence material hardness amount not working with all specular shaders (wardlso toon) and ones that are working such as phong cook tor and blinn are not clamping to the same values as the hardness slider in the material panel. Ideally when a texture is used to pass a certain glossiness/hardness value to the shader it should bypass the hardness value in the material panel. A hardness value of one in the specular material panel should be the same as applying a pure black texture in the hardness influence setting this is not the case with the specular shaders at the moment.

It seems at the moment the range between a full black to full white texture and every value in-between only allows for a range between 30 to 90 with the hardness slider, where as hardness textures should clamp to the full range of the shader 1 ablsolute lowest value 511 absolute highest value

At the moment even when a texture is used say a pure black texture map to give the widest specular highlight possible its still possible to set the hardness value wider in the material properties.

Blender also has whiter hardness maps give wider highlights rather than darker hardness maps giving wider highlights this the reverse of the more standard for glossiness/hardness maps.

Exact steps for others to reproduce the error
Ive made a blend with 3 texture maps set to influence hardness, a full white, full black, and a 50 percent grey to cycle though.

hardnesstester.blend

**System Information** windows 8 amd hd 7950 **Blender Version** 2.69 **Short description of error** Texture maps set to influence material hardness amount not working with all specular shaders (wardlso toon) and ones that are working such as phong cook tor and blinn are not clamping to the same values as the hardness slider in the material panel. Ideally when a texture is used to pass a certain glossiness/hardness value to the shader it should bypass the hardness value in the material panel. A hardness value of one in the specular material panel should be the same as applying a pure black texture in the hardness influence setting this is not the case with the specular shaders at the moment. It seems at the moment the range between a full black to full white texture and every value in-between only allows for a range between 30 to 90 with the hardness slider, where as hardness textures should clamp to the full range of the shader 1 ablsolute lowest value 511 absolute highest value At the moment even when a texture is used say a pure black texture map to give the widest specular highlight possible its still possible to set the hardness value wider in the material properties. Blender also has whiter hardness maps give wider highlights rather than darker hardness maps giving wider highlights this the reverse of the more standard for glossiness/hardness maps. **Exact steps for others to reproduce the error** Ive made a blend with 3 texture maps set to influence hardness, a full white, full black, and a 50 percent grey to cycle though. [hardnesstester.blend](https://archive.blender.org/developer/F33767/hardnesstester.blend)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @xonar

Added subscriber: @xonar
Member

Added subscriber: @kupoman

Added subscriber: @kupoman
Member

Is this problem unique to the Game Engine, or does it apply to the viewport and the material system in general?

Is this problem unique to the Game Engine, or does it apply to the viewport and the material system in general?
Author

Initially I thought it was just related to the glsl view-port and game engine but blender render not cycles has the same problem, so its not just a game-engine thing. I'm quite surprised seeing its also this way in blender internal and it hasn't already been reported as a broken thing, as using a texture to control material glossiness/hardness over the surface of a model is something that's quite standard in the industry not just within games but pre-rendered work also.

Initially I thought it was just related to the glsl view-port and game engine but blender render not cycles has the same problem, so its not just a game-engine thing. I'm quite surprised seeing its also this way in blender internal and it hasn't already been reported as a broken thing, as using a texture to control material glossiness/hardness over the surface of a model is something that's quite standard in the industry not just within games but pre-rendered work also.
Member

Added subscriber: @JorgeBernalMartinez

Added subscriber: @JorgeBernalMartinez
Member

This is really not a bug as this is the way how blender internal/bge works. I'll try explain from I remember when I implemented the wardiso shader almost 10 years ago :-)

The hardness_factor that you set in texture panel only affects in some grade to the hardness value that you can set for the specular shaders in material panel (moreover the hardness value depends on which blend type as Mix, Add, etc between other things that you have set). This hardness value only exists for Phong, CookTorr and Blinn specular shaders but not for WardIso and Toon shaders because as WardIso as Toon don't use the hardness value for anything when their respective specular values are calculated.

Maybe we should remove the hardness_factor when the wardiso & toon specular shaders are chosen.

This is really not a bug as this is the way how blender internal/bge works. I'll try explain from I remember when I implemented the wardiso shader almost 10 years ago :-) The hardness_factor that you set in texture panel only affects in some grade to the hardness value that you can set for the specular shaders in material panel (moreover the hardness value depends on which blend type as Mix, Add, etc between other things that you have set). This hardness value only exists for Phong, CookTorr and Blinn specular shaders but not for WardIso and Toon shaders because as WardIso as Toon don't use the hardness value for anything when their respective specular values are calculated. Maybe we should remove the hardness_factor when the wardiso & toon specular shaders are chosen.
Member

Comment above is just for wardiso & toon shaders not working with hardness_factor.
For the other issue I will investigate deeper.

Comment above is just for wardiso & toon shaders not working with hardness_factor. For the other issue I will investigate deeper.
Member

Added subscriber: @brita

Added subscriber: @brita
Member

Reading through and trying to summarize:

  1. the hardness factor is not doing anything for wardiso and toon shaders -> that is as intended, if there is an interface problem, I couldn't see what.

  2. Sliders and clamping: I see one slider in the texture panel, for the influence, clamping from 0 to 1. Looks correct. I see a slider for hardness in the material panel, depending on the selected specular shader (as it should be according to 1). The texture should override this value, and I never see it with incorrect values, so maybe I did not understood the problem.

  3. Whiter maps give wider specular highlights instead of being black giving the widest -> testing gives me white=small (and focused), black=wide and more dismissive, as should be. Is this still a problem?

Reading through and trying to summarize: 1) the hardness factor is not doing anything for wardiso and toon shaders -> that is as intended, if there is an interface problem, I couldn't see what. 2) Sliders and clamping: I see one slider in the texture panel, for the influence, clamping from 0 to 1. Looks correct. I see a slider for hardness in the material panel, depending on the selected specular shader (as it should be according to 1). The texture should override this value, and I never see it with incorrect values, so maybe I did not understood the problem. 3) Whiter maps give wider specular highlights instead of being black giving the widest -> testing gives me white=small (and focused), black=wide and more dismissive, as should be. Is this still a problem?
Author

No this is still an issue. Tested again with buildbot version b49e6d0.

(1) Yes correct lardloki stated those two shaders do not support texture hardness influence.

About (2) the 0 to 1 clamping in the hardness slider texture panel is not the reported issue but the clamping of the specular hardness slider in the specular shader to the textures hardness influence, which is a 1 to 511 range integer. Black to white texture brightness values can not give the same range of hardness "tightest highlight to widest highlight" when compared to the slider without a texture hardness influence.

A pure black texture does not influence the hardness value of the shader at all, it defaults to the value set with the hardness slider in the shader. This can tested with the current blend by activating the black texture then setting the hardness value in the specular shader itself to its highest value 511 to give the tightest hotspot, the black texture will not influence it "give the specular shader its widest hotspot".

(3) please disregard "Whiter maps give wider specular highlights instead of being black giving the widest" This works correctly.

Im not sure if were linking the same shaders from blender internal or weather or not they can be changed for just the bge to not affect the blenders render shaders as its not just a bge issue but an issue that affects blenders renderer also, but I see no reason to not have it fixed for blender internal also.

No this is still an issue. Tested again with buildbot version b49e6d0. (1) Yes correct lardloki stated those two shaders do not support texture hardness influence. About (2) the 0 to 1 clamping in the hardness slider texture panel is not the reported issue but the clamping of the specular hardness slider in the specular shader to the textures hardness influence, which is a 1 to 511 range integer. Black to white texture brightness values can not give the same range of hardness "tightest highlight to widest highlight" when compared to the slider without a texture hardness influence. A pure black texture does not influence the hardness value of the shader at all, it defaults to the value set with the hardness slider in the shader. This can tested with the current blend by activating the black texture then setting the hardness value in the specular shader itself to its highest value 511 to give the tightest hotspot, the black texture will not influence it "give the specular shader its widest hotspot". (3) please disregard "Whiter maps give wider specular highlights instead of being black giving the widest" This works correctly. Im not sure if were linking the same shaders from blender internal or weather or not they can be changed for just the bge to not affect the blenders render shaders as its not just a bge issue but an issue that affects blenders renderer also, but I see no reason to not have it fixed for blender internal also.
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Inês Almeida self-assigned this 2014-07-21 22:07:56 +02:00
Member

@xonar please tell me how to reproduce the bug in simple steps using that file. I am taking quite some time trying to understand..

@xonar please tell me how to reproduce the bug in simple steps using that file. I am taking quite some time trying to understand..
Member

Changed status from 'Resolved' to: 'Open'

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

I did not meant to close this, but set as incomplete.

I did not meant to close this, but set as incomplete.

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

Added subscriber: @mont29

Added subscriber: @mont29

No news since over a week…

No news since over a week…
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#37653
No description provided.