Thanks again, but I have a new problem
when I pass the world struct to the kernel which contains some value, i cannot get the value stored in the kernel by: float a = world->lights[1].position.x, because when I passed the value of ‘float a’ back to the host it is 0, do you know why?
Thanks again, but I have a new problem
when I pass the world struct to the kernel which contains some value, i cannot get the value stored in the kernel by: float a = world->lights[1].position.x, because when I passed the value of ‘float a’ back to the host it is 0, do you know why?[/quote]
Just realised there is a difference between the struct in the kernel and outside
Just realised there is a difference between the struct in the kernel and outside
Yeah, that can happen. It would be easier if you didn’t use structs. For example, you can pass each camera parameter and light locations using a new kernel argument. Something like this: