Question about the InitRay()

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Post Reply
MonkeyDLuffy
Posts: 8
Joined: Thu Apr 23, 2020 1:50 am

Question about the InitRay()

Post 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
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Question about the InitRay()

Post 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.
Support LuxCoreRender project with salts and bounties
siyanieyoyo
Posts: 2
Joined: Fri Apr 24, 2020 8:19 am

Re: Question about the InitRay()

Post 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?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Question about the InitRay()

Post 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.
Support LuxCoreRender project with salts and bounties
Post Reply