Forum: Poser - OFFICIAL


Subject: Monthly reminder - you need to gamma correct your renders

bagginsbill opened this issue on Feb 01, 2009 · 207 posts


RobynsVeil posted Tue, 14 April 2009 at 7:59 AM

Puzzled.

I was quite certain that if I did "to the power of" maths, it would generate additional nodes that I couldn't re-label or reference. However, now they seem to stay in place, except for the ImageMap node, which seems to have a mind of its own.

Here's the whole script: it's not long. I'm converting a dress texture to GC. I carefully recreated the connections that existed before, except now there's anit-gamma / gamma processing code. Also, instead of connecting to Diffuse_Value, I connect to Alt_Diffuse. Those values I have changedA lot of the original shader is questionable, even to my limited understanding. So, ignoring some of the values for the moment (my biggest issue is the s.Reflection_Value = 3):

def makeSurface(region):
  # Colour / other Maps
  dispBumpMap = ImageMap("VDRflwr_rpd01D.jpg").labelled("Disp-Bump Map")
 
  # !!!!!!!!!!!!!!!!!!! CHANGED
  # convert to linear colour space - this node does not obey '.pos =' directives
  linearColourMap = ImageMap("VDRflwr_rpd03.jpg").labelled("linear ColourMap") ** 2.2
  
  dressClr = IColor(45, 17, 94) #Purple
  venClr03 = IColor(127, 127, 127) #Grey
  venClr04 = IColor(177,153, 200)
  # For the reflection channels
  venClr02 = IColor(205, 198, 255)
 
  if region == "flower":
    reflClr = IColor(0, 0, 255) #Blue
  if region == "dress":
    reflClr = IColor(142, 242, 255) #Light Blue
 
  setWeave = Weave(
    Color_1 = WHITE,
    Color_2 = venClr02,
    Base_Color = BLACK * linearColourMap,
    U_Scale = 1,
    V_Scale = 1, 
    Height = 3, 
    Bias = .3, 
    Gain = .5).labelled("Sets Weave")
  setRefl = SphereMap(reflClr * setWeave).labelled("Sets Reflection")
  setDiff = Diffuse(dressClr * linearColourMap, .7).labelled("Sets Diffuse")
  

!!! Changed - had labels indicating what these nodes did... now they just say Color_Pow

Convert back to sRGB

  gamma = setRefl ** (1 / 2.2)
  gamma2 = setDiff ** (1 / 2.2)
  
  # Arrange nodes
  gamma.inputsCollapsed = 1
  gamma2.inputsCollapsed = 1
  linearColourMap.inputsCollapsed = 1
 
  gamma.pos = 250, 50
  gamma2.pos = 250, 75
  linearColourMap.pos = 250, 100   # doesn't stay there - goes right off the screen
  
  setDiff.pos =  500, 100
  setRefl.pos =  500, 200
  setWeave.pos =  500, 300
 
  dispBumpMap.pos = 720, 300
   
  
  
  # Make the actual surface
  s = Surface(1,0,0,0)
  s.Highlight_Size = .25
  s.Translucence_Color = venClr03 * gamma
  s.Reflection_Color = venClr04 * gamma
  s.Reflection_Value = 3 * gamma
  s.Bump = dispBumpMap * .03
  s.Displacement = dispBumpMap * .006
  s.Alternate_Diffuse = gamma2
  return s
  
outputs += [
  "-Flower", makeSurface("flower"),
  "-Dress", makeSurface("dress"),
#  "-Borders", makeSurface("borders"),
#  "-Ribbon", makeSurface("ribbon"),
]

Just whenever you get to it is fine, Bill... I realize you're an incredibly busy man, and this nonsense must be really frustrating to you. Thanks again for your patience.

Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand] 

Metaphor of Chooks