def asm_code(ren): # eax - ray # ebx - hitpoint code = "#DATA \n" + ren.color_mgr.spectrum_struct() + Ray.struct() + ShadePoint.struct() + """ ray ray1 shadepoint hp1 uint32 ret #CODE macro mov eax, ray1 macro mov ebx, hp1 call ray_scene_intersection mov dword [ret], eax #END """ return code
def asm_code(ren): # eax - ray # ebx - hitpoint code = "#DATA \n" + ren.color_mgr.spectrum_struct() + Ray.struct( ) + ShadePoint.struct() + """ ray ray1 shadepoint hp1 uint32 ret #CODE macro mov eax, ray1 macro mov ebx, hp1 call ray_scene_intersection mov dword [ret], eax #END """ return code
import time from tdasm import Runtime from renmas3.core import Tile from renmas3.samplers import RegularSampler, Sample from renmas3.cameras import Pinhole from renmas3.core import ColorManager, Ray ASM_CODE = """ #DATA """ ASM_CODE += Sample.struct() + Ray.struct() + """ sample sample1 ray ray1 uint32 kraj #CODE macro mov eax, sample1 call get_sample mov dword [kraj], eax macro mov eax, sample1 macro mov ebx, ray1 call get_ray #END """ cam = Pinhole((2,3,4), (5,9,1)) mgr = ColorManager() width = 2 height = 2 sampler = RegularSampler(width, height)