Announcement

Collapse
No announcement yet.

VRayLight directionality

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    After stuffing around a bit I came up with this polynomial, but its far from a perfect match:
    j = 2.47^(i/15.75) - i/10.0- (i/18.0)^2.0 - sin(0.5* i ^pi)
    where i is the directionality in degrees to 90 and
    this gives the multiplier of the original light.

    Comment


    • #17
      I modified the script a bit further and I would like somone with some nous to have a go if possible.
      Code:
      try (delete $testlight) catch()
      try (delete $testlight.target) catch()
      try (delete $Test_LightMeter) catch()
      try (delete $lightGraph ) catch()
      sp = splineShape name:"lightGraph"
      addnewSpline sp
      
      LtTesttarg = targetobject pos:[0,0,0] name:"TestLight.target"
      LtTest = vraylight pos:[0,0,100] targeted:true name:"TestLight"  width:5 height:5 normalizecolor:3 multiplier:1.0 preview_distribution:1 lightDistribution:0.0
      LtTest.target = LtTesttarg
      ltMeter = VRayLightMeter name:"Test_LightMeter" active:true width:10 length:10 orient:true colors:true text:true max:100000.0 min:0.0 pos:[0,0,0]
      MeterReadings = #()
      GraphPoints = #()
      maxVal =1000 as float -- CHANGE VALUE HERE AS 1000 takes a very long time ---- 
      for i = 1 to (maxVal as integer) do 
      (
      	ltTest.lightDistribution = i/maxVal
      	ltMeter.calculate()
      	MeterReadings[i] = ltMeter.direct[5]
      	format "Angle: % Reading: % \n" i MeterReadings[i]
      	DistReading =  ltTest.lightDistribution * 100.0
      	if (MeterReadings[1] != 0 or MeterReadings[1] != undefined) do	addKnot sp 1 #smooth #line [DistReading,-20,MeterReadings[i]/MeterReadings[1]] --#line
      	--j = 	(1.043^i)
      	--k = point pos:[i,-30,j ] centermarker:false  cross:false axistripod:false box:true size:1.0
      )
      --close sp 1
      updateShape sp
      Beware the 1000 light meter reads....
      and the resulting graph has some strange dips and valleys.
      ....

      Comment

      Working...
      X