Endianness

Endianness is an essential concept for Processors, and it often causes some terrible problems for programmers. This article briefly introduced the Endianness by a figure from GAMES104. What’s more, I know a Divide and Conquer method to reverse bits with O(1) for both space and time, so I modified and thus applied this method for reversing Endianness. The C++ code will be attached at the end.

Continue reading

A Method for Estimating the Upper of Russian Roulette

Russian Roulette(RR) is a well-known method of controlling ray recursion times in ray tracing algorithms. Usually, we give a probability P that the ray continues to propagate, however, there may be a small probability of reaching an unexpected depth causing the stack overflow. Therefore, It is reasonable to set a Maximum number of recursion in such a simple ray tracing model whose probability will not change with energy.

Continue reading