From what I see, the position/matrix is stored in the BasicEffect instance, so it makes sense to me that every object has it's own position matrix, but I'm not 100% sure it's correct to let every Entity have it's own BasicEffect instance, so I'm asking here.
|
Probably not. But you could... First of all, you'll note that Secondly: You should usually treat states that go onto the GPU as write-only. The upshot of this is that you generally store the information to generate those states (such as effect parameters) yourself - in your own classes. Then, for each object you draw, you generate the appropriate state and set it on the GPU and follow it up with a draw call. So with a single, shared But - there are scenarios where you might want an To solve this, use the (Note, of course, that |
|||||||||
|
|
BasicEffect is shader program. So it is resource it must be single( to save memory etc). And parameters are passed same as in function. |
|||||
|
|
You have different WVP matrices for each object. But you can create a single
Check this |
|||||||
|