[solved] What's wrong with my sun?

solved

(clepsydrae) #1

Hi –

I’m having trouble with a sun lamp.

If I create a simple scene with a cube with a sun, it works fine: sun is pointing straight down by default, resulting in the top face being illuminated and the side faces only barely.

If I import a mesh using the BlenderGIS plugin and then create a sun lamp, the sun doesn’t seem to work quite right. If I remove the imported mesh and add a simple cube, the sun doesn’t seem to illuminate the top of the cube, only the sides (all of them). If I rotate the default sun on the z axis, nothing happens, as expected. Rotating on X or Y changes the illumination of the scene, but not predictably.

Here is a demo project containing just a cube, a sun lamp, and a camera. For me, that project does not illuminate as I would expect: the top of the cube is not illuminated, despite the sun pointing straight down.

Again, if I make the same project from scratch, there is no problem. But that demo project is “post GIS import”, so apparently the import plugin is doing something to the project settings causing the sun not to work the way I expect it to. Of course if this ends up being a bug with the import plugin I will take it up with the developer, but I’m trying to understand what setting is causing the sun to go wrong.

Any ideas why that demo project doesn’t seem to work correctly? I’m sure it’s something simple!

Thanks!


(Thies Schulz-Holland) #2

Everything in that scene is gargantuan. The cube e.g. is two miles high, wide and deep.
What’s also huge is the size of the sun: 100 ft is way too large. Reduce that to something more reasonable, like e. g. 1 ft and it will render correctly.

The importer seems to mess with the scene scale, no?


(clepsydrae) #3

Thanks for the reply!

Yes, the importer adjusts the scale to the actual scale of the GIS data being imported. In this case I’m importing LiDAR data as a mesh, and the geographic area covered is a mile or three wide.

Is there some reason a sun lamp vector wouldn’t work on a large object? Some kind of overflow happening?

I’ll try making a from-scratch project with no GIS import and see if I can reproduce at the same giant scale… and I’ll see if scaling down helps.


(Thies Schulz-Holland) #4

The issue is not the cube being too large. It’s the sun being that big…
You can keep the cube in its current size, just making the sun smaller will solve your problem.

I assume the importer blindly increases everything in that scene to a larger size. While that makes sense for meshes, I don’t see a benefit of doing the same to lamps, cameras etc.


(clepsydrae) #5

Ah, I see, I’ll try that. I didn’t realize the sun size mattered at all; thought it was only a vector. Does it affect the umbra/penumbra? I’ll check it out. (I’m still a little confused as to why a 100’ sun would make the strange difference it made…)

I made the sun after the import, so I think it’s Blender making the sun larger. I assumed it was Blender intelligently noting that the scene was huge and making things larger. (It makes a camera object a lot larger than usual when I add one post-import, for example.) But maybe it’s doing that in response to some scale variable in the scene that the importer adjusted.

Anyway, when i’m back in front of Blender I’ll try all this out. Thanks!


(clepsydrae) #6

Yep, scaling down the sun fixed it! Thanks a million.

Any idea where the magic scaling variable is configurable for a scene? I didn’t find anything obvious.

Or maybe the plugin is somehow intercepting the creation of a sun? I’m just trying to understand why when I make a new sun it is 100 feet in size (but when I make a sun in a new project, it is tiny.)


(CarlG) #7

I use default Blender units and usually start with sun size ~0.005. That mimics the sun disc size iirc, but then you increase the size to account for corona, atmospheric conditions, clouds and so on.

I’m guessing enormous sun would cause errors due to sample shadow points from silly “locations” (not sure how to describe it given sun is directional and doesn’t occupy a “point in space”).