Anyone who has recently tried Celestia on OS X 10.4.3 (and possibly only on recent video cards) will have noticed that the OpenGL 2.0 render path is now selectable, but gives horribly incorrect rendering.
Since the PC and Linux versions render splendidly (for the most part), this is obviously a bug in Apple's GLSL driver code. So I spent the afternoon copying and pasting Celestia's generated GLSL shader code from /tmp/celestia-shaders.log into Apple's OpenGL Shader Builder. With some experimentation, I think I may have pinned down the issue. Here're test renderings of Saturn's ring shadow with a modified version of Celestia's GLSL code:
Smooth-edged ring shadows are a hallmark of the OGL2 render path. Compare it to the Vertex Program path:
I am pretty sure that Apple's GLSL driver code does not interpret structs, or at least uniform structs correctly. As Celestia declares lights using uniform structs (this is 100% ok by the way), this was why previously the GL 2.0 path did not render lighting properly.
The screenshots substitute gl_LightSource[i] for all uses of the light struct. This is incorrect so the lighting direction is off, etc, but it does demonstrate that the light struct was not being recognized properly before. This is enough info I think to file a detailed bug report with Apple.
Experiments with OpenGL 2.0 on OS X
I always knew that Apple is a shi%&*# software company when it comes to video card drivers. . I hate'em ! They need to be kicked in the ba*&%$ . I had so much troubles with their crappy %#@$ video cards and OS X before SHAME ON YOU APPLE ! . This is frustrating me beyond any reasonable description.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"
-
- Posts: 408
- Joined: 27.03.2002
- With us: 22 years 8 months
- Location: Leiden, The Netherlands
Wow :)
This is certainly good news. There actually is a solution thinkable.
The guys at Apple should thank you for hunting down their bugs.
This is certainly good news. There actually is a solution thinkable.
The guys at Apple should thank you for hunting down their bugs.
Lapinism matters!
http://settuno.com/
http://settuno.com/
Chris has implemented a workaround for the aforementioned issue and here are some screenshots:
This shows off the basic stuff (notice that Saturn now renders correctly), as well as multiple illumination on a fictional planet in a quadruple star system (this, minus a star). The star system looks like this. Multiple illumination and smooth ring shadows only appear in the OpenGL 2.0 render path.
However not all is rosy, as it turns out eclipse shadows have issues:
This is a solar eclipse (I got the cel url from here) with an eclipse shadow on the Pacific Ocean. It's mostly all right, but if you look closely there are some stripe artifacts caused by an interaction between eclipse shadows and night textures. I'm still investigating whether this is another driver bug or not. Still, this is very exciting stuff and I'm literally losing sleep debugging and testing this!
This shows off the basic stuff (notice that Saturn now renders correctly), as well as multiple illumination on a fictional planet in a quadruple star system (this, minus a star). The star system looks like this. Multiple illumination and smooth ring shadows only appear in the OpenGL 2.0 render path.
However not all is rosy, as it turns out eclipse shadows have issues:
This is a solar eclipse (I got the cel url from here) with an eclipse shadow on the Pacific Ocean. It's mostly all right, but if you look closely there are some stripe artifacts caused by an interaction between eclipse shadows and night textures. I'm still investigating whether this is another driver bug or not. Still, this is very exciting stuff and I'm literally losing sleep debugging and testing this!