## Light group scale

Discussion related to the development & design of the LuxRender Graphical User Interface
coordinator: none (position is open)

Moderator: coordinators

### Light group scale

Hi,

when playing with the light group scale option, it struck me that it migth be better that the scale is logarithmic. That is, the slider goes from say -4 to 4, causing the scale to vary between 10^-4 and 10^4. This would allow for a greater range and would imho also be more intutative since brightness is linear in log-space.

To experiment I modified FlexImageFilm as follows:
Code: Select all
void FlexImageFilm::SetGroupScale(u_int index, float value){   if (index >= bufferGroups.size())      return;   value = Clamp<float>(value, 0, 100);   bufferGroups[index].globalScale = powf(10.f, (value / 12.5) - 4);   ComputeGroupScale(index);}float FlexImageFilm::GetGroupScale(u_int index) const{   if (index >= bufferGroups.size())      return 0.f;   float value = log10f(bufferGroups[index].globalScale);   value = Clamp<float>((value + 4) * 12.5, 0, 100);   return value;}

what do you think?

edit: if it were to be implemented, the true scale should be written in the text field or something.
May contain traces of nuts.

Lord Crc

Posts: 4518
Joined: Sat Nov 17, 2007 2:10 pm

### Re: Light group scale

Hi,

This is GUI stuff, don't put it in fleximage. Otherwise the idea suits me. The same should be done for linear tonemapper exposure setting.

Jeanphi
jeanphi

Posts: 6624
Joined: Mon Jan 14, 2008 7:21 am

### Re: Light group scale

Hey,

I was thinking about this a few days ago, my plan was to make it into 2 sliders, a scale 0-2 and a multiplier.
I guess we could make the multiplier logarithmic, and have the scale slider as a 'fine' control. ?

Posts: 3968
Joined: Wed Sep 19, 2007 2:13 am

### Re: Light group scale

jeanphi wrote:This is GUI stuff, don't put it in fleximage. Otherwise the idea suits me. The same should be done for linear tonemapper exposure setting.

It was easier to hack it in there for testing, since I didn't have to redo the sliders and all If we adopt it, it certainly should go in the GUI section
May contain traces of nuts.

Lord Crc

Posts: 4518
Joined: Sat Nov 17, 2007 2:10 pm

### Re: Light group scale

Radiance wrote:I was thinking about this a few days ago, my plan was to make it into 2 sliders, a scale 0-2 and a multiplier.
I guess we could make the multiplier logarithmic, and have the scale slider as a 'fine' control. ?

Ah hmm, that could work. Alternatively we could have one slider which is from say -5 to 5, then another which is -0.5 to 0.5, which is added to the first, ie scale is then pow(10, slider1.value + slider2.value). Then again, hard to say what I'd like best until I get to play with it
May contain traces of nuts.

Lord Crc

Posts: 4518
Joined: Sat Nov 17, 2007 2:10 pm

### Re: Light group scale

Lord Crc wrote:It was easier to hack it in there for testing, since I didn't have to redo the sliders and all If we adopt it, it certainly should go in the GUI section

Hmm, no need to redo the sliders. You just have to change wxluxgui.cpp or did I missed something?

Jeanphi
jeanphi

Posts: 6624
Joined: Mon Jan 14, 2008 7:21 am

### Re: Light group scale

Probably not. Just that I'm not well versed in the GUI code, and I don't know what's generated and what's not. Easier to hack the code you know
May contain traces of nuts.

Lord Crc

Posts: 4518
Joined: Sat Nov 17, 2007 2:10 pm

### Re: Light group scale

don't worry, i'll add this tonight to wxluxgui.cpp-h