I’m updating a Custom Renderer macro for 4045 and need to automatically get the Sun Elevation for a Combiner Strength parameter. I’ve looked at the available Report parameters and have not seen anything suitable. Just in case it’s in there somewhere, I thought I’d ask.
If it isn’t there, I’d suggest a new parameter device: Report Viewport Lighting.
This allows you to use a Report Height rather than report Color device. By setting the lighting to no skylight and only direct diffuse sunlight, the value you receive will be exactly the cosine similarity / dot product of the angle to the sun and a straight-up vector.
One minor bug; the Constant has to be outside the macro for the “Use Viewport Light Direction” option to update automatically. I kept the macro, but it’s down to this:
LOL! It’s just a Radial Gradient with the Type set to Spherical. Viewed from the top, it looks close enough.
I was going to share the .tmd, but without the material files it’s just a blank hemisphere. If anyone wants it for a template, I’ll add some simple procedural texture and post it. For now, I canat least post the two macros:
Yes, I just expanded the Radial Gradient to create the mask. Then I fed that to the Meshify device. I fed the mesh to the Scene View instead of using the heightmap.
I spent today replicating the “Fast Stone Surface” used above as a WM native procedural material. It isn’t seamless, but it does have infinite bounds like WM worlds. I included the material hemisphere, which is useful for making icons/preview images of WM based materials. (I have a green background in the layers device to clip in Photoshop/GIMP, since the grid background is a pain to remove manually.)
@Stephen In that .tmd is a little snippet I came up with to handle position/placement in macros or when coordinating control of multiple devices throughout the graph. I got most of it working as intended, but came across an odd behavior when it came to rotation: