Jump to content

Impostor lighting changes dramatically with camera angle


photo

Recommended Posts

I noticed a while ago that the billboard lighting changes more dramatically than it should when the camera rotates. Attached are some screenshots illustrating what I mean. The sun angle is almost straight overhead in these. The first screenshot is looking slightly down, and the billboards look ok. The second screenshot is looking straight out over the terrain and the billboards receive no lighting from the sun at all. The third screenshot is looking directly down at the ground, and the billboards receive full lighting. The difference between looking straight across the terrain versus looking down makes it very difficult to balance the ground cover to where it blends overall. 

 

I'm also not convinced that the lighting is coming from the correct angle. In the fourth screenshot I circled the sun in red, but the lighting is clearly coming from 90 degrees to the right, as indicated by the blue arrow. I've also attached the impostor's normal map used in the screenshots.

post-1189-0-09456000-1435093244_thumb.jpg

post-1189-0-30026300-1435093258_thumb.jpg

post-1189-0-92216600-1435093269_thumb.jpg

post-1189-0-12675400-1435094700_thumb.jpg

vegetation_juniperoxy_large_impostor_n.rar

Link to comment
  • 2 weeks later...

So I figured out the bug with the lighting coming from the wrong direction. The grabber tool creates a normal map in the ATI2 format, aka 3Dc, which when loaded into Photoshop using nvidia's dds tools looks like this: post-1189-0-95679100-1436376833_thumb.jpg

 

when it's supposed to look like this: post-1189-0-63506200-1436376871_thumb.jpg

 

Notice the r and g channels are flipped, the red channel is inverted, and a blue channel is created. According to nvidia, there's a normal flag check in the code to determine if a 3Dc file is a normal map. My guess is that the flag is missing from the files grabber generates. From what I gather, it has to do with the order in which the image editor decompresses the different formats' R and G channels. So while trying to fix the problems in this thread: https://developer.unigine.com/forum/topic/3318-grabber-tool-taking-incorrect-images/?hl=grabber#entry17609I've been opening the normal map and diffuse in Photoshop and manually rearranging the order of the panels to get proper rotation, but because of inconsistencies in the 3Dc format save/load process, the normal that opens is completely wrong, resulting in really botched lighting when the atlas is saved out. 

 

I've also noticed a couple interesting new bugs. When grabber generates an atlas, it flips the image along it's x axis. In the attached screenshot, you can see the original model down at the bottom, with the correct arrow direction highlighted in blue, and the incorrect billboard's arrow direction, highlighted in red.

post-1189-0-52226800-1436378545_thumb.jpg

 

Another bug in this screenshot is that some of the billboards correctly display the middle arrow with the torus pointing straight up, while others show it from a different angle on the vertical axis, despite the billboards being viewed from the same angle. I think this might be making some of our tree billboards appear shorter than they should be.

Link to comment
×
×
  • Create New...