IES Light for workspace
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
IES Light for workspace
This is an update to an old script that reads and ies light profile and simulates it in workspace by altering the spotlight mask image.
Improvements:
Auto installer and button instead of a script node in the scene
Better error checking = fewer script crashes
Works with spotlights and projector lights
Option to make the light compatible with the Indigo Renderer export script(update coming soon)
Find it near the bottom of the page here:
http://www.clintons3d.com/plugins/trues ... index.html"
Improvements:
Auto installer and button instead of a script node in the scene
Better error checking = fewer script crashes
Works with spotlights and projector lights
Option to make the light compatible with the Indigo Renderer export script(update coming soon)
Find it near the bottom of the page here:
http://www.clintons3d.com/plugins/trues ... index.html"
-
Draise
- Captain
- Posts: 3200
- Joined: 21 Sep 2009, 19:33
- Type the number ten into the box: 0
- Location: Bogota, Colombia
Re: IES Light for workspace
Wow awesome! Thanks! Looks very nice indeed. Need to get back into trueSpace to test out the lighting! Cool!
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: IES Light for workspace
Update.
The spot cone generator script is now part of the ies light generator.
new falloff exponent for spot cone generator
height and width inputs for spot cone generator
cleaner node connections for the ies generator - more reliable
set ies spotlight near clip value to a small value for better lighting of nearby surfaces
ies added a mask so don't see the square image artifacts
http://clintons3d.com/plugins/truespace ... light.html"
The spot cone generator script is now part of the ies light generator.
new falloff exponent for spot cone generator
height and width inputs for spot cone generator
cleaner node connections for the ies generator - more reliable
set ies spotlight near clip value to a small value for better lighting of nearby surfaces
ies added a mask so don't see the square image artifacts
http://clintons3d.com/plugins/truespace ... light.html"
-
Draise
- Captain
- Posts: 3200
- Joined: 21 Sep 2009, 19:33
- Type the number ten into the box: 0
- Location: Bogota, Colombia
Re: IES Light for workspace
Very nice updates.
-
seppgirty
- Master Chief Petty Officer
- Posts: 354
- Joined: 22 May 2009, 03:34
- Type the number ten into the box: 0
- Location: pittsburgh Pa.
Re: IES Light for workspace
Great job Clinton. Glad to see you updating your pluggins.
truespace 3.2, 5.2, 6.6, ani-pack, flash plugin,........ you can check out my films athttp://www.chaosbrosfilms.com
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: IES Light for workspace
It's me AGAIN
Can you take a peak at your genericSpot script?
Getting an error when using Generate Spotlight Falloff for a UU Projector light
Line 73
Also, if you have not noticed, the UU Projector light has the SpotCone exported out And...I was comparing your YafaRay IES Spot with your use of the Image Gamma and Image Blur
Is this something you could also include, replacement for the Post Process, or is this specific to the YafaRay4tS Edit: Unless I am missing something, IES should only be used on Spot lights
Is there a way to exclude everything except Spot lights?
Edit2: After working with your IES Light for Workspace script, I think it would be best if I make the following changes to the Unofficial Updates:
For the Projector I am going to move the Square bitmap inside the Projector Preferences, un export the SpotCone attribute, and Copy the Square bitmap to the SpotCone verses Connecting/Disconnecting
Still do not see any value in using the IES profiles for the Projector though.
Also plan on adding your IES profiles script to the Lights toolbars
Can you take a peak at your genericSpot script?
Getting an error when using Generate Spotlight Falloff for a UU Projector light
Line 73
Also, if you have not noticed, the UU Projector light has the SpotCone exported out And...I was comparing your YafaRay IES Spot with your use of the Image Gamma and Image Blur
Is this something you could also include, replacement for the Post Process, or is this specific to the YafaRay4tS Edit: Unless I am missing something, IES should only be used on Spot lights
Is there a way to exclude everything except Spot lights?
Edit2: After working with your IES Light for Workspace script, I think it would be best if I make the following changes to the Unofficial Updates:
For the Projector I am going to move the Square bitmap inside the Projector Preferences, un export the SpotCone attribute, and Copy the Square bitmap to the SpotCone verses Connecting/Disconnecting
Still do not see any value in using the IES profiles for the Projector though.
Also plan on adding your IES profiles script to the Lights toolbars
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: IES Light for workspace
trueBlue wrote: 07 Jul 2020, 21:55 It's me AGAIN![]()
...
That trueBlue guy, always causing trouble.
I'll see what I can find out.trueBlue wrote: 07 Jul 2020, 21:55 ...
Can you take a peak at your genericSpot script?
...
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: IES Light for workspace
ME ?
No
Never!
Finally figured out what was not working.
The above existing code does not work as you would think.
In making a Reset script, I had to do this.
This is what I have come up with, by a different name, and there is still a problem with the genericSpot script
Edit: I got it:
Removed due to update
No
Never!
Finally figured out what was not working.
Code: Select all
shadowmap = sel + "/SpotlightShader/ShadowMap";
if(!Node.Exists(shadowmap))
shadowmap = sel + "/Spot Preferences/ShadowMap"
In making a Reset script, I had to do this.
Code: Select all
var SpotAngle = params.ConValue('SpotAngle');
if(!Node.IsLight(Node.Selection())) return;
var sel = Node.Selection()
var shadowmap = sel + "/SpotlightShader/ShadowMap";
if(Node.Exists(shadowmap)) {
Node.ConReset(shadowmap,"SpotCone");
Node.Value(sel,"Angle") = SpotAngle
}
if(!Node.Exists(shadowmap)) {
var shadowmap1 = sel + "/Spot Preferences/ShadowMap";
Node.ConReset(shadowmap1,"SpotCone");
Node.Value(sel,"Angle") = SpotAngle
}
if(!Node.Exists(shadowmap)) {
var shadowmap2 = sel + "/Projector Preferences/ShadowMap";
Node.ConReset(shadowmap2,"SpotCone");
Node.Value(sel,"Angle") = SpotAngle
}
Edit: I got it:
Code: Select all
var shadowmap = sel + "/SpotlightShader/ShadowMap";
if(Node.Exists(shadowmap))
Node.Value(shadowmap,"SpotCone") = cbitmap;
if(!Node.Exists(shadowmap))
var shadowmap1 = sel + "/Spot Preferences/ShadowMap";
if(Node.Exists(shadowmap1))
Node.Value(shadowmap1,"SpotCone") = cbitmap;
if(!Node.Exists(shadowmap))
var shadowmap2 = sel + "/Projector Preferences/ShadowMap";
if(Node.Exists(shadowmap2))
Node.Value(shadowmap2,"SpotCone") = cbitmap;
}
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: IES Light for workspace
Autoload attached is old style pre-persistent.
Added changes for the latest UU version of projector light.
Put same light tests in both generic and ies light generators.
Bitmap connector reset uses simple reset command
This code already tests for spot and projector lights.
I don't know why you want to remove it from projector lights.
I haven't looked at the yafaray ies yet.
Added changes for the latest UU version of projector light.
Put same light tests in both generic and ies light generators.
Bitmap connector reset uses simple reset command
This code already tests for spot and projector lights.
I don't know why you want to remove it from projector lights.
I haven't looked at the yafaray ies yet.
- Attachments
-
- IESConverterAutoload03.RsObj
- (370.18 KiB) Downloaded 188 times
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: IES Light for workspace
yafaray top left, ies script top right, unreal engine bottom left, blender cycles bottom right
Looking at the Yafaray IES light shows that it is a better representation than the ies converter script. It looks better and it is closer in appearance to a Blender and Unreal Engine render for the same ies file.
I think this comment note inside the yafaray code is the reason the black streaks don't go as far in as the others.
Looking at the Yafaray IES light shows that it is a better representation than the ies converter script. It looks better and it is closer in appearance to a Blender and Unreal Engine render for the same ies file.
I think this comment note inside the yafaray code is the reason the black streaks don't go as far in as the others.
Code: Select all
//
//NOTE - values are not projected from 3D sphere to 2D circle
//-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: IES Light for workspace
Tested your changes and it works great!clintonman wrote: 09 Jul 2020, 04:31 Autoload attached is old style pre-persistent.
Added changes for the latest UU version of projector light.
Put same light tests in both generic and ies light generators.
Bitmap connector reset uses simple reset command
This code already tests for spot and projector lights.
I don't know why you want to remove it from projector lights.
I haven't looked at the yafaray ies yet.
Are you planning any updates?
I would suggest that you modify your ies script to run only if a light is selected!
Add
if(!Node.IsLight(firstSel)) return;
Change the toolbar button's LMB and RMB commands to only open if a light is selected.
Add
if(!Node.IsLight(Node.Selection())) return;
Also the copyBitmap and genericSpot scripts will need to account for the up coming unofficial update(s)
For the Projector I am going to move the Square bitmap inside the Projector Preferences, un export the SpotCone attribute, and Copy the Square bitmap to the SpotCone verses Connecting/Disconnecting in the Square/Spot button script
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: IES Light for workspace
if(!Node.IsLight(Node.Selection())) return;
Won't work if more than 1 light is selected.
I'm not going to worry about fixing it to work with the UU lights until you're done making changes. Want to avoid chasing a moving target.
I will likely make a change to the generator script. For example the ies data I was testing defines values at 0 and 90 degrees. The script copies the values to 0,90,180 and 270 degrees for a full circle. The change would fill the in between values so it's not so blocky. Nothing planned for the yafaray ies because it's close to what it should be and because of math.
Won't work if more than 1 light is selected.
I'm not going to worry about fixing it to work with the UU lights until you're done making changes. Want to avoid chasing a moving target.
I will likely make a change to the generator script. For example the ies data I was testing defines values at 0 and 90 degrees. The script copies the values to 0,90,180 and 270 degrees for a full circle. The change would fill the in between values so it's not so blocky. Nothing planned for the yafaray ies because it's close to what it should be and because of math.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: IES Light for workspace
Confirmed.clintonman wrote: 09 Jul 2020, 14:48 if(!Node.IsLight(Node.Selection())) return;
Won't work if more than 1 light is selected.
Is that a bad thang?
Once the panel is up you can apply the generated ies bitmap to more then one selected light.
Is there a command that would work with multiple selected lights?
I do like the simplicity of the incorporated IES in the YafaRay IES Spot light.
There is the possibility that a user could have the R2Texture running if it is not used correctly!
When I first looked into incorporating your IES Profiles, I started out using what you have in the YafaRay IES Spot light.
What causes this banding?
If I uncheck Alpha Value Only there is less to no banding on a few test that I have run. On another note, I think the YafaRay IES Spot light needs to be updated.
As it is the IES bitmap is hooked up to the SpotCone, so there is no bitmap until you load a IES file
Probably should fix it to copy the bitmap instead of hooking it up.
Node.Value(System.ThisOwner() + "/IES Spot Preferences/ShadowMap", "SpotCone") = Node.Value(System.ThisOwner() + "/Image Blur", "Bitmap")
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: IES Light for workspace
I do not know if you can do this in your code, but if you could create a black or transparent border (3 pixels) around the image, the banding is eliminated.
Before After Spot light with IES Import Also there is a partial solution using an InputBitmap's Border
Seems to only remove the banding on the right and bottom of the bitmap by adding a 3 pixel Border Color (Black) to the bitmap
Using Border in the V_AddressMode does not seem to do anything.
Before After Spot light with IES Import Also there is a partial solution using an InputBitmap's Border
Seems to only remove the banding on the right and bottom of the bitmap by adding a 3 pixel Border Color (Black) to the bitmap
Using Border in the V_AddressMode does not seem to do anything.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: IES Light for workspace
The blur maybe the most likely culprit. 3 pixel blur needs a 3 pixel border and I suspect the blur affects the top and left less than the bottom and right.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: IES Light for workspace
Yes the Blur is the only thing that I could not get to work with this HACK
Reading your genericSpot script:
var halfWidthMinusBuffer = halfWidth - 3;//keep away from image edges
var halfHeightMinusBuffer = halfHeight - 3;//keep away from image edges
Is this the missing code needed for the IESImport script?
var halfWidthMinusBuffer = halfWidth - 3;//keep away from image edges
var halfHeightMinusBuffer = halfHeight - 3;//keep away from image edges
Is this the missing code needed for the IESImport script?
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: IES Light for workspace
left is new improved and right is the original
First refinement of the ies projection. The dark bands are much thinner now. Next is improve the direction going in and out of the center.
First refinement of the ies projection. The dark bands are much thinner now. Next is improve the direction going in and out of the center.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: IES Light for workspace
actual ies data
The image shows the data that comes from the ies file. What I'm doing now is filling up all the in between parts of the lighting.
The image shows the data that comes from the ies file. What I'm doing now is filling up all the in between parts of the lighting.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: IES Light for workspace
top left to bottom right - original, interpolated horizontal, interpolated both directions, yafaray
Added a gamma control and full interpolation to the ies data values.
It looks fuzzier now, but that could be due to the much increased size of the effect.
While working on the interpolated values version I ran into some problems and ended up moving things around in the ies scripts. I changed the projection sphere geometry and uv mapping and moved the camera. I need to figure out the ideal look for the ies lights so I know what direction to take it or if it's ok as is now.
Added a gamma control and full interpolation to the ies data values.
It looks fuzzier now, but that could be due to the much increased size of the effect.
While working on the interpolated values version I ran into some problems and ended up moving things around in the ies scripts. I changed the projection sphere geometry and uv mapping and moved the camera. I need to figure out the ideal look for the ies lights so I know what direction to take it or if it's ok as is now.
- Attachments
-
- ConvertSpotToIES12.RsObj
- (304.17 KiB) Downloaded 182 times
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: IES Light for workspace
You can get rid of the lines in the yafaray ies light with the following change.trueBlue wrote: 10 Jul 2020, 14:21 Yes the Blur is the only thing that I could not get to work with this HACK![]()
Hack.png
Reading your genericSpot script:
var halfWidthMinusBuffer = halfWidth - 3;//keep away from image edges
var halfHeightMinusBuffer = halfHeight - 3;//keep away from image edges
Is this the missing code needed for the IESImport script?
Code: Select all
//allow for blur line 175 IESimport
//if(dist > 126)
if(dist > 122)
val = 0.0;
else {
//var angdist = 127*Math.acos(dist/127);
angdist = dist;
lumvalIndex = Math.floor(angdist/126*(numVert-1));
val0 = vertdata0[lumvalIndex];
val0 = val0/maxval;
val1 = vertdata1[lumvalIndex];
val1 = val1/maxval;
val = val0*(1-angleScaled) + val1*angleScaled;
}-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: IES Light for workspace
Awesome!clintonman wrote: 11 Jul 2020, 05:07You can get rid of the lines in the yafaray ies light with the following change.trueBlue wrote: 10 Jul 2020, 14:21 Yes the Blur is the only thing that I could not get to work with this HACK![]()
Hack.png
Reading your genericSpot script:
var halfWidthMinusBuffer = halfWidth - 3;//keep away from image edges
var halfHeightMinusBuffer = halfHeight - 3;//keep away from image edges
Is this the missing code needed for the IESImport script?Code: Select all
//allow for blur line 175 IESimport //if(dist > 126) if(dist > 122) val = 0.0; else { //var angdist = 127*Math.acos(dist/127); angdist = dist; lumvalIndex = Math.floor(angdist/126*(numVert-1)); val0 = vertdata0[lumvalIndex]; val0 = val0/maxval; val1 = vertdata1[lumvalIndex]; val1 = val1/maxval; val = val0*(1-angleScaled) + val1*angleScaled; }
Works great!
Thank you!
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: IES Light for workspace
After I made the following corrections to the ies script, because of a couple of errors, this works great!clintonman wrote: 11 Jul 2020, 03:31 iesImprovement2.jpg
top left to bottom right - original, interpolated horizontal, interpolated both directions, yafaray
Added a gamma control and full interpolation to the ies data values.
It looks fuzzier now, but that could be due to the much increased size of the effect.
While working on the interpolated values version I ran into some problems and ended up moving things around in the ies scripts. I changed the projection sphere geometry and uv mapping and moved the camera. I need to figure out the ideal look for the ies lights so I know what direction to take it or if it's ok as is now.
Code: Select all
//hres = 360; Error Undefined
var hres = 360;
//mybitmap = System.CreateDO("Common Data Package/Bitmap Data");
var mybitmap = System.CreateDO("Common Data Package/Bitmap Data");
BFMT_UNKNOWN = 0;
BFMT_A8R8G8B8 = 1;
BFMT_A16B16G16R16 = 2;
BFMT_A32fB32fG32fR32f = 3;
BFMT_R8 = 4;
BFMT_R16 = 5;
BFMT_R32f = 6;
BFMT_FORCE_DWORD = -1;
// System.Trace(hres);
// System.Trace(vertnum);
//mybitmap.Create(hres,vertnum*2,BFMT_A32fB32fG32fR32f);
//assume vertical always 90 degrees
// mybitmap.Create(hres,90,BFMT_A32fB32fG32fR32f); Error Invalid
mybitmap.Create(360,90,BFMT_A32fB32fG32fR32f);
Add to the top of the script else it runs on anything selected
Code: Select all
if(!Node.IsLight(firstSel)) return;Is it really necessary to set:
Code: Select all
Node.Value(firstSel, "Angle") = 2.9;Code: Select all
Node.Value(firstSel, "Near_clip_plane") = 0.01;-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: IES Light for workspace
IES lights are defined by a sphere shape or in many cases half a sphere. Only half sphere types work in tS because a spotlight can only open about that far. Having a low angle means you see the light half sphere squashed into a narrow angle far less than a half sphere.trueBlue wrote: 11 Jul 2020, 13:24 Question?
Is it really necessary to set:AndCode: Select all
Node.Value(firstSel, "Angle") = 2.9;Code: Select all
Node.Value(firstSel, "Near_clip_plane") = 0.01;
From website release note for June 28 2015, "set ies spotlight near clip value to a small value for better lighting of nearby surfaces parallel to the light orientation"
Here's a couple of links for more info on how ies works and a program I'm about to try out.
https://docs.unrealengine.com/en-US/Eng ... index.html
http://photometricviewer.com/
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: IES Light for workspace
Thanks, I actually read those links before posting.
Also the link supplied in your code.
http://lumen.iee.put.poznan.pl/kw/iesna.txt
Lots to consider for sure!
Have no idea how you are able to read a text file and make a bitmap out of numbers!
But i am super appreciative!
So again, many thanks!
I do suspect now, from reading your post about adjusting the Camera how you were able to remove the white gradient from the edges of bitmap though.
By moving the camera away from the Sphere?
Also the link supplied in your code.
http://lumen.iee.put.poznan.pl/kw/iesna.txt
Lots to consider for sure!
Have no idea how you are able to read a text file and make a bitmap out of numbers!
But i am super appreciative!
So again, many thanks!
I do suspect now, from reading your post about adjusting the Camera how you were able to remove the white gradient from the edges of bitmap though.
By moving the camera away from the Sphere?
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: IES Light for workspace
By chopping the sphere in half, adjusting the uv and moving the camera back so sphere fills but not overfills the view.trueBlue wrote: 11 Jul 2020, 18:48 ...
I do suspect now, from reading your post about adjusting the Camera how you were able to remove the white gradient from the edges of bitmap though.
By moving the camera away from the Sphere?
there is also a circular mask that's added at the end of the process that's not needed anymore because of those changes.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: IES Light for workspace
With regards to the "Near Clip Plane"
Spot light with no IES bitmap, Near Clip Plane = 0.500 the default
Note: The shadow of the Infinity object is not in the view of the Spot light's (Rear) projection
Next image:
Spot light with no IES bitmap, Near Clip Plane = 0.001
Note: No Shadow
Not sure if this is a good thing or a bad thing trueSpace's Spot lights are odd.
The Spot light widget's design (Halfway) tries to project in one direction.
I am aware of the Hardware setting, BTW.
I guess where I am leading to is there should be a way to restore the Angle, Near Clip Plane, and SpotCone that is being changed by the IES Profiles.
I am able to capture the Angle value and restore it, but only for the first selected light, and only after the first IES Bitmap is applied with the Cancel script.
Of course this would not work on multiple selected lights either.
The only thing I can think of is have a script that restores those settings to their Default values, for a single selected light.
You could modify (or modify the code with a Bool/Check for multiple selected lights) to only work on the first selected light.
The Angle is not such a big deal but I think changing the Near Clip Plane might be.
Sorry to be a pain!
Spot light with no IES bitmap, Near Clip Plane = 0.500 the default
Note: The shadow of the Infinity object is not in the view of the Spot light's (Rear) projection
Spot light with no IES bitmap, Near Clip Plane = 0.001
Note: No Shadow
Not sure if this is a good thing or a bad thing trueSpace's Spot lights are odd.
The Spot light widget's design (Halfway) tries to project in one direction.
I am aware of the Hardware setting, BTW.
I guess where I am leading to is there should be a way to restore the Angle, Near Clip Plane, and SpotCone that is being changed by the IES Profiles.
I am able to capture the Angle value and restore it, but only for the first selected light, and only after the first IES Bitmap is applied with the Cancel script.
Of course this would not work on multiple selected lights either.
The only thing I can think of is have a script that restores those settings to their Default values, for a single selected light.
You could modify (or modify the code with a Bool/Check for multiple selected lights) to only work on the first selected light.
The Angle is not such a big deal but I think changing the Near Clip Plane might be.
Sorry to be a pain!
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: IES Light for workspace
As noted above, in the ies script, I had to exchange hres with 360 as shown belowtrueBlue wrote: 11 Jul 2020, 13:24After I made the following corrections to the ies script, because of a couple of errors, this works great!clintonman wrote: 11 Jul 2020, 03:31 iesImprovement2.jpg
top left to bottom right - original, interpolated horizontal, interpolated both directions, yafaray
Added a gamma control and full interpolation to the ies data values.
It looks fuzzier now, but that could be due to the much increased size of the effect.
While working on the interpolated values version I ran into some problems and ended up moving things around in the ies scripts. I changed the projection sphere geometry and uv mapping and moved the camera. I need to figure out the ideal look for the ies lights so I know what direction to take it or if it's ok as is now.Also...Code: Select all
//hres = 360; Error Undefined var hres = 360; //mybitmap = System.CreateDO("Common Data Package/Bitmap Data"); var mybitmap = System.CreateDO("Common Data Package/Bitmap Data"); BFMT_UNKNOWN = 0; BFMT_A8R8G8B8 = 1; BFMT_A16B16G16R16 = 2; BFMT_A32fB32fG32fR32f = 3; BFMT_R8 = 4; BFMT_R16 = 5; BFMT_R32f = 6; BFMT_FORCE_DWORD = -1; // System.Trace(hres); // System.Trace(vertnum); //mybitmap.Create(hres,vertnum*2,BFMT_A32fB32fG32fR32f); //assume vertical always 90 degrees // mybitmap.Create(hres,90,BFMT_A32fB32fG32fR32f); Error Invalid mybitmap.Create(360,90,BFMT_A32fB32fG32fR32f);
Add to the top of the script else it runs on anything selectedQuestion?Code: Select all
if(!Node.IsLight(firstSel)) return;
Is it really necessary to set:AndCode: Select all
Node.Value(firstSel, "Angle") = 2.9;Code: Select all
Node.Value(firstSel, "Near_clip_plane") = 0.01;
// mybitmap.Create(hres,90,BFMT_A32fB32fG32fR32f); Error Invalid
mybitmap.Create(360,90,BFMT_A32fB32fG32fR32f);
It has been working for several days, now I am getting an invalid error with the above and the following
mybitmap.SetPixel(u,j,color);
Are units suppose to be integers?
SetPixel(unit, unit, obj)
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: IES Light for workspace
probablytrueBlue wrote: 15 Jul 2020, 17:11
It has been working for several days, now I am getting an invalid error with the above and the following
mybitmap.SetPixel(u,j,color);
Are units suppose to be integers?
SetPixel(unit, unit, obj)
you can try something like below to see what values you're feeding it and make sure they make sense
Code: Select all
try {
mybitmap.SetPixel(u,j,color);
} catch(e) {
System.Trace(u)
System.Trace(j)
} -
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: IES Light for workspace
I had to add the try & catch to every line that included mybitmap
The log ran for a couple of minutes showing different integers, nothing else.
No additional errors and the bitmap was not created.
The log ran for a couple of minutes showing different integers, nothing else.
No additional errors and the bitmap was not created.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: IES Light for workspace
July 16 2020 Update
persistent install
bug - properly use data from files that occupy the 90 to 180 degree vertical region
changed projection camera and sphere geometry and removed masking code
removed post process and other unneeded elements
added a brightness control
interpolated data for a smoother result
http://clintons3d.com/plugins/truespace ... light.html
persistent install
bug - properly use data from files that occupy the 90 to 180 degree vertical region
changed projection camera and sphere geometry and removed masking code
removed post process and other unneeded elements
added a brightness control
interpolated data for a smoother result
http://clintons3d.com/plugins/truespace ... light.html
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: IES Light for workspace
Update is looking good!
I confirmed why I was getting errors with the ies script and it is very bizarre!
First off let me explain
In tS761, I commented all of the //System.Trace() lines
No problem so far in tS761
In tS761Std, I was getting the error with
mybitmap = System.CreateDO("Common Data Package/Bitmap Data");
I removed the comments from the System.Trace() lines
No errors
Seriously?
I noticed a few other things...
ConvertSpotToIES July 16, 2020
1) copyBitmap script does not support new Projector in UU6
I added one line
2) genericSpot script does not support new Projector in UU6
I added one line
3) copy indigo nodes script is looking for these removed nodes:
radiusToSquare
radiusToSquare3
Plane primitive
4) Regenerating the IES Bitmap is inconsistent
I have been testing running the ies script twice and it seems promising, albeit a tiny bit slower.
Activity.Run('%THIS_NAME%' + "/ies");
Activity.Run('%THIS_NAME%' + "/ies");
I confirmed why I was getting errors with the ies script and it is very bizarre!
First off let me explain
In tS761, I commented all of the //System.Trace() lines
No problem so far in tS761
In tS761Std, I was getting the error with
mybitmap = System.CreateDO("Common Data Package/Bitmap Data");
I removed the comments from the System.Trace() lines
No errors
Seriously?
I noticed a few other things...
ConvertSpotToIES July 16, 2020
1) copyBitmap script does not support new Projector in UU6
I added one line
Code: Select all
if(Node.Exists(firstSel + "/Projector Preferences/ShadowMap")) {
Node.Value(firstSel + "/Projector Preferences/ShadowMap", "SpotCone") = thebitmap; //UU6
if(Node.Exists(firstSel + "/Square"))
Node.Value(firstSel + "/Square", "Bitmap") = thebitmap;
}
I added one line
Code: Select all
if(Node.Exists(sel + "/Projector Preferences/ShadowMap")) {
Node.Value(sel + "/Projector Preferences/ShadowMap", "SpotCone") = cbitmap;
if(Node.Exists(sel + "/Square"))
Node.Value(sel + "/Square", "Bitmap") = cbitmap;
}
radiusToSquare
radiusToSquare3
Plane primitive
4) Regenerating the IES Bitmap is inconsistent
I have been testing running the ies script twice and it seems promising, albeit a tiny bit slower.
Activity.Run('%THIS_NAME%' + "/ies");
Activity.Run('%THIS_NAME%' + "/ies");
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: IES Light for workspace
Thanks, a lot of good info there. Forgot about your latest changes and never tested the indigo portion.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: IES Light for workspace
Ugh back to errors in tS761
Hope you can understand my notes:
ies script
comment
//System.Trace()
error "mybitmap" comment
//SystemTrace
Add var
var mybitmap
error "undefined" Do not comment ANY System.Trace()
var mybitmap
No errors
Still testing...
Hope you can understand my notes:
ies script
comment
//System.Trace()
error "mybitmap" comment
//SystemTrace
Add var
var mybitmap
error "undefined" Do not comment ANY System.Trace()
var mybitmap
No errors
Still testing...
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: IES Light for workspace
Nope, can't tell from this. Depends what your code looks like. I'll look at the UU release version when I'm at my test machine.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: IES Light for workspace
July 17 2020 Update
Replaced missing indigo nodes
fixed to work with new unofficial update projector lights
Replaced missing indigo nodes
fixed to work with new unofficial update projector lights
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: IES Light for workspace
I forgot to mention the first step, which may be a clue.trueBlue wrote: 17 Jul 2020, 17:58 Ugh back to errors in tS761
Hope you can understand my notes:
ies script
comment
//System.Trace()
error "mybitmap"
mybitmap is undefined.png
comment
//SystemTrace
Add var
var mybitmap
error "undefined"
undefined is null or not an object.png
Do not comment ANY System.Trace()
var mybitmap
No errors
Still testing...
The ies script worked before I applied the UUpdate
Edit: Cross post
Can you upload those missing files so I do not have to go through the whole process again?
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: IES Light for workspace
Here are the missing Indigo nodes for the ies light scripts.
- Attachments
-
- radiusToSquare3.RsObj
- (7.04 KiB) Downloaded 163 times
-
- radiusToSquare.RsObj
- (7.03 KiB) Downloaded 200 times
-
- Plane primitive.RsObj
- (26.01 KiB) Downloaded 204 times

















