11
$\begingroup$

I have a very "precise"(through setting "SpherePoints") Sphere illuminated by hundreds of random color lighting sources. The resulted Graphics3D turns out to be extremely slow for rendering and rotating. How can I make it faster without losing the visual quality?

Graphics3D[
        {Specularity[White, 0], Sphere[]},
        Lighting -> (
                {"Spot",
                            Hue[RandomReal[], 1, .02],
                            {{0, #, 1.1}, {0, #, 0}},
                            π/5
                            } & /@ (.8 Range[-1, 1, .01])
                ),
        ViewPoint -> {0, 0, 4},
        ViewVertical -> {1, 0, 0},
        Method -> {"SpherePoints" -> 10 {50, 50}},
        RotationAction -> "Clip"
        ] // Style[#, Antialiasing -> False] &

a sphere with multiple lighting sources

I would prefer keeping everything inside Mathematica. But solutions based on 3rd party tools would also be welcome!

$\endgroup$
  • 8
    $\begingroup$ rendering speed of 3D in M is known to be slow, I complained about this for long time. The more data you have the slower it gets. Here is a post How to improve performance of Graphics3D rendering with Dynamics Notice no reply and nothing on this post. No body seems to care about this. Sometimes you can speed things up by removing some 3D stuff, like opacity will slow things, etc... but the whole problem is that M renders 3D slow. That is why I stopped using Manipulate for 3D physics simulation. Too slow. $\endgroup$ – Nasser Nov 25 '14 at 5:28
  • 1
    $\begingroup$ @Nasser I remember when back to MMA 4, there used to be some OpenGL solutions on this kind of problems. I'm hoping to find a similar one that uses MMA as generating engine but some more powerful tools as rendering engine. (btw upvoted there) $\endgroup$ – Silvia Nov 25 '14 at 5:38
  • 7
    $\begingroup$ You must be talking about openGL viewer by Jens-Peer Kuska, who was a Mathematica expert (sadly passed away when only 45 years old). I remember using it also. I do not know if it would have helped or not, may be. If you want to do heavy duty 3D simulation, I do not think M is the right tool. Too bad, since its 3D API is really nice and well designed and easy to use to build 3D objects with, but if it is slow to render, none of this matters at the end. Here is the openGL viewer manual $\endgroup$ – Nasser Nov 25 '14 at 5:56
  • 1
    $\begingroup$ @Nasser Thanks for the information. I had found it too, but too late to edit my comment. I didn't know Mr. Kuska has passed away... Really sorry to hear that... I listened his speech on the OpenGL viewer and it's fascinating. $\endgroup$ – Silvia Nov 25 '14 at 6:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.