| We hope you enjoy your visit. You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you are already a member please log in to your account to access all of our features: |
| raytracing | |
|---|---|
| Tweet Topic Started: Apr 8 2009, 03:52 PM (275 Views) | |
| Atarian | Apr 8 2009, 03:52 PM Post #1 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
i am creating a pod racing game, now this has terrain and the pod and it's thruster will react to this, i have worked out a method but before i start working on it i need one simple question answered how slow is ray-tracing ? i don't really want a by second answer because i'm sure that there are so many variables. but to give you a better idea i will most likely need to do between 7 and 28 of them each step to calculate the correct positions now if this is unviable then i will need some help for a better idea. Thanks in advance Atarian |
![]() |
|
| Dr. Best | Apr 8 2009, 04:40 PM Post #2 |
|
Administrator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
The efficiency of ray-tracing tests depends mostly on the number of triangles for which the test is performed. For terrains the test is always quite fast, because there are several optimizations. For models a bounding box test is done first, so the triangles are only checked, if the model is somewhere close to the ray. For this reason it can be good to have several small models. Primitives are always checked on a per-triangle base. For single triangles and for bounding boxes the test is very fast, but if it has to check thousands of triangles it can get slow. Using invisible, simplified collision geometry can speed things up. Generally ray-tracing tests are quite expensive and it is better to have only few of them. To get more particular time values for your scene just do a little benchmark. Do the same ray-tracing test hundred times and measure the time it took (e.g. through GM's variable current_time). |
![]() |
|
| Atarian | Apr 8 2009, 10:35 PM Post #3 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
thanks for the advice Dr. best doing 1000 takes around 16 milliseconds and i get around 60 FPS with my main (but untextured) model with the 1000 raytraces, so i think even up to 40 will be fine, now to workout my system, the fun part! but one last question, is there any way to limit how far the ray traces, and would this speed up the operation? Thanks again Atarian Edited by Atarian, Apr 8 2009, 10:40 PM.
|
![]() |
|
| Eansis | Apr 8 2009, 11:42 PM Post #4 |
|
ghost
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Random tidbit your better off not knowing: GM struggles with using one call to a multiplication operator each step If i were to, say DO THIS Step repeat (100000) x=3*4; GM would not be able to run at 60 fps C++ could get the same framerate doing 10000000 of those operation (100x more) |
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY
| |
![]() |
|
| Dr. Best | Apr 9 2009, 02:00 PM Post #5 |
|
Administrator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
If it would be possible, it would speed it up, but it is not. Regarding your benchmark: Are you sure that the rays intersected the bounding box of the model? Because if they did not do so it would be quite unrepresentative. |
![]() |
|
| « Previous Topic · Questions about Ultimate 3D · Next Topic » |





![]](http://z1.ifrm.com/static/1/pip_r.png)



10:21 AM Jul 11