Make model don't use too much memory#77
Conversation
This reverts commit 7c234d2.
|
Some context for the PR: The main memory usage is from the 35 gates, each gate have approx 2-4 wire models. For each wire model, there is 48 variants, 2 (flip) * 6 (faces) * 4 (rotation). Each model contain 100-200 Vector3. Each Vector3 contains 3 double which means 24 bytes. A very conservation calculation already gives This PR reduce the 48 variants to 2 variants, resulting in 24x lower memory usage. The PR changes the model transformations to be computed on the fly during The This PR also won't increase the memory usage of the |
Improve the model rendering code so it doesn't instantiate 48 models but only 2 models. The rotation of the model is delayed and calculated together with the translation. The lighting calculation is also included.