By default,what kind of render does panda3d belong to?Phong?Blinn Phong? or other something?
I moved your question to a new topic because it’s unrelated to the topic you posted it in.
Panda uses Lambert for diffuse lighting and Blinn-Phong for specular lighting. With custom shaders, or panda3d-simplepbr, different shader models can be used.
OK,Sorry to have caused you so much trouble.
Thanks for your warm-hearted reply.
I am going to search what is Lambert and Blinn-Phong.
There are too many things I need to learn.
Does panda3d support multithread rendering by default?
I have checked some samples and I just discovered that some of them could use 2~3 threads.
And…Do we support intel better than ryzen?
Panda3D supports multithreaded rendering:
https://docs.panda3d.org/1.10/python/programming/rendering-process/multithreaded-render-pipeline
I don’t know about Intel versus Ryzen. There’s nothing in Panda that would make it specifically work better on one processor or the other.
I have read that,thank you.
And great to hear that we didn’t treat intel and AMD differently.
So how many threads does panda3d support?
And…how could we use that feature?Is there any samples?
BTW,I searched Internet and I just find that almost everyone tell me OpenGL doesn’t support multithread rendering.So I’m curious that how could panda3d work with it.
The manual page I linked describes everything you need to know about the multithreaded render pipeline.
Up to 3 threads can be used for the multithreaded rendering pipeline. Other threads can be used by Panda for operations like asynchronous model and texture loading.
It’s true that OpenGL doesn’t support multi-threaded rendering. What Panda does is execute the actual OpenGL calls on a single thread (the Draw thread), and the other threads are used for other CPU work that is done in preparation for that rendering, such as scene graph traversal and culling (done on the Cull thread) and collisions and physics (done on the App thread).
See these pages for more information about using additional threads:
https://docs.panda3d.org/1.10/python/programming/tasks-and-events/threading
https://docs.panda3d.org/1.10/python/programming/advanced-loading/async
Thanks.
So what setting do we need to use when we get 1000 collision sphere?
The collision system does not have parallelism at this point. Are you experiencing performance issues with 1000 collision spheres? Those can possibly be addressed in another way. Perhaps it is possible to run multiple collision traversers on multiple threads, but I would investigate other ways first.
Well,actually I got a demo,which can show us 1000 collision sphere generation.In this way it can test panda3d’s performance.
I just find that it can use 2~3 threads on my CPU.
So I am curious if there is a way to enhance the efficiency.
For example,loading models or rendering models by multithread or other something we can do to optimize it.
Maybe you could set your collision system so that for each collision sphere only the collisions against the near neighbours are being checked. It is waste of resources to check collisions for two spheres that are in the opposite ends of the world for example.
This won’t of course actually increase the collision check performance but it allows you to “cheat” in your demo by not checking the collisions that are for sure not happening.
In a real game, I would go with this route rather than throwing more CPU cores at the problem. It is easy to disable the collisions from enemies that are too far away from the player.
But before doing anything, have to used pstats
to identify your bottlenecks?
Panda already does this optimisation automatically if you organise your scene graph hierarchically.
Oh,That is a good idea.
So how to do that?
Any code demo please?
Do you mean PStats? If so, take a look at this manual page.
The short version, however, is to start PStats in a terminal/command-line (as appropriate to your OS), add “want-pstats 1” to the PRC-options in your program (perhaps via a call to “loadPrcFileData”), and to then run your program. The PStats view should pop up and provide you with a graph, along with menus that can provide other graphs.
There are more details and nuances, but that’s the basic idea, I believe.
If you mean the suggestion of only checking nearby colliders, then, as rdb indicated, I believe that Panda already does this by itself.
That’s really powerful.