Page 1 of 1

Question about the InitRay()

Posted: Wed Jul 15, 2020 6:59 am
by MonkeyDLuffy
I wonder that meaning of this code.
Pras = Point(filmX, filmHeight - filmY - 1.f, 0.f);
https://github.com/LuxCoreRender/LuxCor ... ve.cpp#L86

Re: Question about the InitRay()

Posted: Wed Jul 15, 2020 9:19 am
by Dade
MonkeyDLuffy wrote: Wed Jul 15, 2020 6:59 am I wonder that meaning of this code.
Pras = Point(filmX, filmHeight - filmY - 1.f, 0.f);
https://github.com/LuxCoreRender/LuxCor ... ve.cpp#L86
Do you mean the "filmHeight - filmY - 1.f" part ? It is there to flip the image along Y axis or it would be rendered upside down.

Re: Question about the InitRay()

Posted: Thu Jul 16, 2020 2:09 am
by siyanieyoyo
It is flipped using "filmHeight - filmY - 1.f" when inputting and then we need to flip it back using "y = height - y - 1" for the output?
https://github.com/LuxCoreRender/LuxCor ... t.cpp#L514
Is it necessary to do so?

Re: Question about the InitRay()

Posted: Thu Jul 16, 2020 8:04 am
by Dade
siyanieyoyo wrote: Thu Jul 16, 2020 2:09 am It is flipped using "filmHeight - filmY - 1.f" when inputting and then we need to flip it back using "y = height - y - 1" for the output?
https://github.com/LuxCoreRender/LuxCor ... t.cpp#L514
Is it necessary to do so?
Yes, if you remove both, the file output will be still the same but the in-memory frame buffer will be flipped. So they are required to have the memory frame buffer and file output as old Lux had.