Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#3628 closed enhancement (fixed)

Add command to turn off all directional lighting for a model

Reported by: Tristan Croll Owned by: Tom Goddard
Priority: normal Milestone:
Component: Graphics Version:
Keywords: Cc: Elaine Meng
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The following bug report has been submitted:
Platform:        Linux-3.10.0-1127.13.1.el7.x86_64-x86_64-with-centos-7.8.2003-Core
ChimeraX Version: 1.0 (2020-06-04 23:15:07 UTC)
Description
It seems that "lighting model #2 shadows false multi false" doesn't turn off directional shadows - model #2 comes out looking flat only in "soft" or "flat" lighting modes, not in "simple", "full" or "shadow".

Log:
UCSF ChimeraX version: 1.0 (2020-06-04)  
© 2016-2020 Regents of the University of California. All rights reserved.  
How to cite UCSF ChimeraX  

> open 3io0 format mmcif fromDatabase pdb

3io0 title:  
Crystal structure of EtuB from Clostridium kluyveri [more info...]  
  
Chain information for 3io0 #1  
---  
Chain | Description  
A | EtuB protein  
  
3io0 mmCIF Assemblies  
---  
1| author_and_software_defined_assembly  
  

> usage draw

"draw" is not a command name  

> show

> ui mousemode right label

> ui mousemode right "mark point"

> marker #2 position 77,75.38,63.37 color yellow radius 1

> ui mousemode right "resize markers"

> marker change #2:1 radius 3.421

> usage lighting

lighting [preset] [direction direction] [intensity a number] [color a color]
[fillDirection fillDirection] [fillIntensity a number] [fillColor a color]
[ambientIntensity a number] [ambientColor a color] [depthCue true or false]
[depthCueStart a number] [depthCueEnd a number] [depthCueColor a color]
[moveWithCamera true or false] [shadows true or false] [qualityOfShadows a
text string] [depthBias a number] [multiShadow an integer] [msMapSize an
integer] [msDepthBias a number]  
— report or alter lighting parameters  
preset: one of default, flat, full, gentle, simple, or soft  
direction: some numbers  
fillDirection: some numbers

lighting model models [depthCue true or false] [shadows true or false]
[multiShadow true or false]  
— Turn off depth cue or shadows for individual models even when globally they
are enabled.  

> lighting #2 shadows false

Expected one of 'default', 'flat', 'full', 'gentle', 'simple', or 'soft' or a
keyword  

> lighting #2 shadows flat

Expected one of 'default', 'flat', 'full', 'gentle', 'simple', or 'soft' or a
keyword  

> lighting #2 flat

Expected one of 'default', 'flat', 'full', 'gentle', 'simple', or 'soft' or a
keyword  

> lighting flat #2

Expected a keyword  

> lighting model #2 shadows false

> lighting model #2 flat

Expected a keyword  

> lighting model #2 multiShadow false

> lighting model #2 multiShadow false shadows false

> lighting shadows false

> lighting shadows false multiShadow false

Invalid "multiShadow" argument: Expected an integer  

> lighting model #2 multiShadow false

> lighting flat

> lighting simple

> lighting model #2

Model #2: depth_cue: True, shadows: False, multi_shadow: False  

> lighting model #2 depthCue false

> lighting model #2 depthCue false multiShadow false shadows false

> lighting model #2 depthCue false multiShadow false

> lighting flat

> lighting #1 shadows t

Expected one of 'default', 'flat', 'full', 'gentle', 'simple', or 'soft' or a
keyword  

> lighting model #1 shadows true

> lighting model #1 shadows true multiShadow true

> lighting multiShadow

Missing "multiShadow" keyword's argument  

> lighting multiShadow 5

> lighting multiShadow 1

> lighting multiShadow 0

> lighting simple

> ui tool show Shell

/opt/UCSF/ChimeraX/lib/python3.7/site-packages/IPython/core/history.py:226:
UserWarning: IPython History requires SQLite, your history will not be saved  
warn("IPython History requires SQLite, your history will not be saved")  

> hide #2 models

> show #2 models

> lighting simple

> lighting flat

> usage light model

lighting model models [depthCue true or false] [shadows true or false]
[multiShadow true or false]  
— Turn off depth cue or shadows for individual models even when globally they
are enabled.  

> lighting soft

> select clear

> lighting simple

> lighting soft

> lighting shadows true intensity 0.5

> lighting simple

> lighting soft

> lighting full

> lighting flat

> lighting full

> lighting model #2 shadows false multiShadow false

> lighting soft

> lighting simple

> lighting full

> lighting shadows false

> lighting full




OpenGL version: 3.3.0 NVIDIA 450.51.05
OpenGL renderer: TITAN Xp/PCIe/SSE2
OpenGL vendor: NVIDIA Corporation
Manufacturer: Dell Inc.
Model: Precision T5600
OS: CentOS Linux 7 Core
Architecture: 64bit ELF
CPU: 32 Intel(R) Xeon(R) CPU E5-2687W 0 @ 3.10GHz
Cache Size: 20480 KB
Memory:
	              total        used        free      shared  buff/cache   available
	Mem:            62G        3.8G         42G        161M         16G         58G
	Swap:          4.9G          0B        4.9G

Graphics:
	03:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP102 [TITAN Xp] [10de:1b02] (rev a1)	
	Subsystem: NVIDIA Corporation Device [10de:11df]	
	Kernel driver in use: nvidia
PyQt version: 5.12.3
Compiled Qt version: 5.12.4
Runtime Qt version: 5.12.8

Change History (8)

comment:1 by Eric Pettersen, 5 years ago

Component: UnassignedGraphics
Owner: set to Tom Goddard
Platform: all
Project: ChimeraX
Status: newassigned
Summary: ChimeraX bug report submission"shadows false" doesn't always turn off shadows

comment:2 by Tom Goddard, 5 years ago

Turning off shadows does not result in "flat" lighting. The key and fill directional lights cause different brightness on an object based on the angle between the light direction and the surface normal, and the key light causes specular highlights that depend on how the key light would reflect off of the surface based on its normal. Currently there is no command to turn off all directional lighting, although the Drawing class has a flag to do this Drawing.use_lighting.

comment:3 by Tom Goddard, 5 years ago

Cc: Elaine Meng added
Resolution: fixed
Status: assignedclosed
Summary: "shadows false" doesn't always turn off shadowsAdd command to turn off all directional lighting for a model
Type: defectenhancement

I added an option "directional true/false" to the lighting model command to turn off all directional lighting (including shadows).

lighting model #2 directional false

This will produce the uniform color appearance you wanted.

in reply to:  4 ; comment:4 by Tristan Croll, 5 years ago

For what it's worth, the reason I was playing with it was to suggest a 
(reasonably) simple way to give the approximate effect Andrea Dallapè 
was asking about ("draw a circle"). Placing a marker equidistant from 
her three points, scaling it to the right radius and turning its 
lighting off *might* do the job.

On 2020-08-17 18:04, ChimeraX wrote:

in reply to:  5 ; comment:5 by Elaine Meng, 5 years ago

I don't understand why there needs to be a separate setting for this.  If you don't want shading, you would use ambient light instead of key/fill light.  I thought that was the distinguishing characteristic of ambient light, thus no need to introduce another parameter.

in reply to:  6 ; comment:6 by Tristan Croll, 5 years ago

Hi Elaine,

This is a per-model setting - i.e. “make this model completely flat while others have directional lighting and/or shadows”.

— Tristan


in reply to:  7 ; comment:7 by Elaine Meng, 5 years ago

Ah thanks.  So basically "lighting flat" but limited to the specified model(s).

in reply to:  8 ; comment:8 by goddard@…, 5 years ago

It is not quite the same as "lighting flat" although the effect is similar.  With "lighting flat" the key and fill light intensity are set to 0 and the ambient intensity is 1.45.  But with directional turned off there is no lighting, not even ambient, so the ambientIntensity will have no effect (also ambientColor will have no effect).  The color of the object will not have its brightness modified in any way except for depth cue (if enabled).  So directional off means don't use key,fill,ambient at all.  I realize using the word "directional" is slightly misleading since "ambient" is not directional, but it was the best option name I could think of.

Note: See TracTickets for help on using tickets.