I'm an amateur in 3D game development. The thing I want to know is shading related. For reflection purpose, which will be the efficient way? Either "Realtime render to Cubemap" or "Ray trace based" reflection? In which way I will get better frames per second and my gpu gets less tired? No matter which API I use (e.g. DirectX, GL, GL ES, Metal). And please note my question is out of any game engine.
For games, there are two main reflection techniques.
You mentionned cube maps that is one of them. Cubemaps are good for reflections on arbitrary complex objects (sphere, teapots, ...). One other advantage is that they can also easely handle reflections on normal mapped objects.
In terms of computing poxer needs, you have to be aware that for each reflecting objects, you have to render 6 times you scenes to the cube map. There are several optimisation possible (not render cube map at each frame, use low def render surface, ...) but it remains costly.
The other way is to use "portal" related techniques that are very well described in this question.
The main advantage of this technique is that you will only require one more rendering pass. Another good point is that you can handle mirrors reflecting mirrors in a more complete and easy way than with cube maps (still it is not esay to handle such cases).
The main drawback is that you have to cull objects that are behind the reflective surface. Another drawback is that reflective surface must be a plane.
Raytracing in real time games is, afaik not used because it is too much resource hungry.
Cubemaps are much much faster than realtime (raytraced is realtime) although it does have its disadvantages.
Cube mapping is preferred over other methods of environment mapping because of its relative simplicity. Also, cube mapping produces results that are similar to those obtained by ray tracing, but is much more computationally efficient – the moderate reduction in quality is compensated for by large gains in efficiency.