Colored shadows #13422

Closed
opened 2008-05-29 15:44:35 +02:00 by Roland Hess · 11 comments

%%%This patch provides a control for changing the color (and thereby the intensity) of cast shadows, on a per-lamp basis. This is useful for trick effects (weird club lighting), as well as subtle shading in scenes (cooling or warming shadows).

The main use, though, is in changing shadow color to shades of gray, which has the effect of lowering shadow intensity without altering the overall energy of the lamp. Many times in my own lighting rigs, I am happy with the quality of lighting but find that shadows are too dark. Setting shadow color to, say RGB (.5, .5, .5) has the effect of cutting shadow density in half without having to add additional light sources that could effect your overall scheme. This has cut some of my lighting rigs in half, as I no longer have to have two-lamp clusters for every light source (one for lighting energy and one set to Only Shadow for shadow intensity). Setting shadow color to white RGB (1,1,1) causes the shadow to effectively disappear, as though shadows were not enabled.

The colored shadowing technique plays nice with all of Blender's shadowing types (ray, buff-halfway, buff-irregular), lamp types (spot, sun, area, point), ray options (soft shadow, area lamp with samples), and transparency (irregular buff alpha and ray transp + filter). It also works for Only Shadow, and processes into passes correctly as demonstrated in the provided test .BLEND files.

One other fun feature is the TEX button beside the color swatch, which causes the lamp texture to affect the shadow as well (it normally does not). The effect produced is one that has the lamp's texture seem to "pass through" the object and integrate with the shadow for special effects.

Attached is the patch against current trunk, plus four simple .BLEND files that show the integration.%%%

%%%This patch provides a control for changing the color (and thereby the intensity) of cast shadows, on a per-lamp basis. This is useful for trick effects (weird club lighting), as well as subtle shading in scenes (cooling or warming shadows). The main use, though, is in changing shadow color to shades of gray, which has the effect of lowering shadow intensity without altering the overall energy of the lamp. Many times in my own lighting rigs, I am happy with the quality of lighting but find that shadows are too dark. Setting shadow color to, say RGB (.5, .5, .5) has the effect of cutting shadow density in half without having to add additional light sources that could effect your overall scheme. This has cut some of my lighting rigs in half, as I no longer have to have two-lamp clusters for every light source (one for lighting energy and one set to Only Shadow for shadow intensity). Setting shadow color to white RGB (1,1,1) causes the shadow to effectively disappear, as though shadows were not enabled. The colored shadowing technique plays nice with all of Blender's shadowing types (ray, buff-halfway, buff-irregular), lamp types (spot, sun, area, point), ray options (soft shadow, area lamp with samples), and transparency (irregular buff alpha and ray transp + filter). It also works for Only Shadow, and processes into passes correctly as demonstrated in the provided test .BLEND files. One other fun feature is the TEX button beside the color swatch, which causes the lamp texture to affect the shadow as well (it normally does not). The effect produced is one that has the lamp's texture seem to "pass through" the object and integrate with the shadow for special effects. Attached is the patch against current trunk, plus four simple .BLEND files that show the integration.%%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Member

%%%Awesome, Ive being wanting this for so long, sometimes the least you want is to make your node setup more complicated just for adding colors to shadows!%%%

%%%Awesome, Ive being wanting this for so long, sometimes the least you want is to make your node setup more complicated just for adding colors to shadows!%%%
Member

%%%Hey, I had a quick look at the code, and the pictures seem pretty nice!

I'm not so keen on the 'Tex' button though, it seems like really 'bolted on' and to be adding on another layer of complexity to the workflow, rather than fitting in the existing texture system.

What I think would be much better (perhaps more difficult to implement, but much better in terms of design) would be to make 'Shadow' an option in the lamp texture's Map To panel. Currently there is only 'Col'. What this would mean is that it would be easy to set up to do the same thing as this patch - just click both 'Col' and 'Shadow' in the texture - but also would give a lot more flexibility, allowing other combinations such as different textures on light and shadow , or flat colour light with textured shadow. The latter combination would allow using a fake 'caustic map' - [x] very easily, that just gets projected into the shadows but not in the actual lighting.

Anyway, if that's going to be too difficult, then it'd be cool to make a stage 1 patch with just the shadow colour without texturing options, and work on that later. I really think integrating it with the texture system is the correct solution here.

cheers

%%%Hey, I had a quick look at the code, and the pictures seem pretty nice! I'm not so keen on the 'Tex' button though, it seems like really 'bolted on' and to be adding on another layer of complexity to the workflow, rather than fitting in the existing texture system. What I think would be much better (perhaps more difficult to implement, but much better in terms of design) would be to make 'Shadow' an option in the lamp texture's Map To panel. Currently there is only 'Col'. What this would mean is that it would be easy to set up to do the same thing as this patch - just click both 'Col' and 'Shadow' in the texture - but also would give a lot more flexibility, allowing other combinations such as different textures on light and shadow , or flat colour light with textured shadow. The latter combination would allow using a fake 'caustic map' - [x] very easily, that just gets projected into the shadows but not in the actual lighting. Anyway, if that's going to be too difficult, then it'd be cool to make a stage 1 patch with just the shadow colour without texturing options, and work on that later. I really think integrating it with the texture system is the correct solution here. cheers - [x] http://www.lysator.liu.se/~kand/caustics/ %%%
Author

%%%Agreed. That would be significantly more powerful and fit better with the existing texturing paradigm. I'll see if I can't roll that in tomorrow.%%%

%%%Agreed. That would be significantly more powerful and fit better with the existing texturing paradigm. I'll see if I can't roll that in tomorrow.%%%
Member

%%%Yikes, I just re-read my second sentence. I should remember not to write things first thing in the morning without coffee. Looking forward to the next iteration!%%%

%%%Yikes, I just re-read my second sentence. I should remember not to write things first thing in the morning without coffee. Looking forward to the next iteration!%%%
Member

%%%Cool! Sounds really useful.

Joe%%%

%%%Cool! Sounds really useful. Joe%%%
Author

%%%Okay. Updated everything so the texturing option is now in the texture buttons. You can enabled/disable shadow texturing per item in the texture stack, meaning that you can, for example, have a lamp with a nice "causticy" texture that is mapped only to a colored shadow in Add mode, creating a fake caustic (if you place it nicely with tex coords from an Empty). I'm sure there are other ways to use this as well that creative artists will discover.

While I was in there, I fixed a minor shenanigans with Lamp Color flags being misused within material textures.

We should see if we can get Andy G to take a build for a test drive too, as his input on lighting issues will be valuable.%%%

%%%Okay. Updated everything so the texturing option is now in the texture buttons. You can enabled/disable shadow texturing per item in the texture stack, meaning that you can, for example, have a lamp with a nice "causticy" texture that is mapped only to a colored shadow in Add mode, creating a fake caustic (if you place it nicely with tex coords from an Empty). I'm sure there are other ways to use this as well that creative artists will discover. While I was in there, I fixed a minor shenanigans with Lamp Color flags being misused within material textures. We should see if we can get Andy G to take a build for a test drive too, as his input on lighting issues will be valuable.%%%
Author

%%%Howdy Ton -- updated patch to work with current svn (8/13/08). I know you're at SIGGRAPH, so this will be a "nice" present for when you get back.

I've made a page, linked below, with technical information and demonstrations as well as artists' info, etc., to make review of this patch as easy as possible. Also, I've linked to the ba.org thread where people have been barking about it.

http://www.harkyman.com/2008/08/06/controllable-shadow-intensity-and-color/

http://blenderartists.org/forum/showthread.php?t=132325%%%

%%%Howdy Ton -- updated patch to work with current svn (8/13/08). I know you're at SIGGRAPH, so this will be a "nice" present for when you get back. I've made a page, linked below, with technical information and demonstrations as well as artists' info, etc., to make review of this patch as easy as possible. Also, I've linked to the ba.org thread where people have been barking about it. http://www.harkyman.com/2008/08/06/controllable-shadow-intensity-and-color/ http://blenderartists.org/forum/showthread.php?t=132325%%%
Member

%%%Excellent, thanks for updating, this is great functionallity%%%

%%%Excellent, thanks for updating, this is great functionallity%%%
Member

%%%In svn, thanks for the work and convincing doc Roland! :)%%%

%%%In svn, thanks for the work and convincing doc Roland! :)%%%
Member

Changed status from 'Open' to: 'Archived'

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