Hey guys,
I made a minimalistic 3D engine some time ago. It has been a while since I have done any serious programming so instead of just grabbing the code again, I thought I'd just remake it. Its for fun anyway so I have no time limit/restrictions. Anyway, my question is this: is there any rule of thumb so to speak on whether its better to eat CPU cycles or more RAM to save CPU cycles?
This is more of an opinion based question. One of the issues I am having is that when I define an object, it is made up of surfaces which are themselves made up of vertices. These vertices can have duplicates in memory due to different surfaces using the same vertex. I could make it less memory intensive but it will obviously eat CPU cycles by searching a list for the data.
Another small issue is one for the offset. Most objects are obviously defined at the origin and then moved around through their offset. I can either integrate the offset value into the object's coordinates or just leave it as a separate variable and recompute the final result every draw cycle.
Any opinions would be appreciated, thanks. Just in case it makes a difference, this will be written in C++. Does language actually matter in the whole CPU vs RAM argument?
I made a minimalistic 3D engine some time ago. It has been a while since I have done any serious programming so instead of just grabbing the code again, I thought I'd just remake it. Its for fun anyway so I have no time limit/restrictions. Anyway, my question is this: is there any rule of thumb so to speak on whether its better to eat CPU cycles or more RAM to save CPU cycles?
This is more of an opinion based question. One of the issues I am having is that when I define an object, it is made up of surfaces which are themselves made up of vertices. These vertices can have duplicates in memory due to different surfaces using the same vertex. I could make it less memory intensive but it will obviously eat CPU cycles by searching a list for the data.
Another small issue is one for the offset. Most objects are obviously defined at the origin and then moved around through their offset. I can either integrate the offset value into the object's coordinates or just leave it as a separate variable and recompute the final result every draw cycle.
Any opinions would be appreciated, thanks. Just in case it makes a difference, this will be written in C++. Does language actually matter in the whole CPU vs RAM argument?