From 441a8bff859baa0679a8e55dc0717cae47e6d112 Mon Sep 17 00:00:00 2001 From: Joao Victor Dell Agli Date: Mon, 10 Jul 2023 12:06:40 -0300 Subject: [PATCH 1/4] Week 6 Blogpost --- .../2023/2023-07-10-week-6-joaodellagli.rst | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 docs/source/posts/2023/2023-07-10-week-6-joaodellagli.rst diff --git a/docs/source/posts/2023/2023-07-10-week-6-joaodellagli.rst b/docs/source/posts/2023/2023-07-10-week-6-joaodellagli.rst new file mode 100644 index 000000000..26e6fcea9 --- /dev/null +++ b/docs/source/posts/2023/2023-07-10-week-6-joaodellagli.rst @@ -0,0 +1,53 @@ +Week 6: Things are Starting to Build Up +======================================= + +.. post:: July 10, 2023 + :author: João Victor Dell Agli Floriano + :tags: google + :category: gsoc + + +Hello everyone, time for a other weekly blogpost! Today, I will show you my current progress on my project and latest activities. + +What I did Last Week +-------------------- +Last week I had the goal to implement KDE rendering to the screen (if you want to understand what this is, check my :doc:`last blogpost <2023-07-03-week-5-joaodellagli>`). +After some days diving into the code, I finally managed to do it: + +.. image:: + :align: center + :alt: KDE render to a billboard + +This render may seem clean and working, but the code isn't exactly like that. For this to work, some tricks and work arounds needed to +be done, as I will describe in the section below. + +Also, I reviewed the shader part of Tania's PR `#791 `_, that implement ellipsoid actors inside +FURY. It was my first review of a PR that isn't a blogpost, so it was an interesting experience and I hope I can get better at it. + +It is important as well to point out that I had to dedicate myself to finishing my graduation capstone project's presentation that I will attend +to this week, so I had my time limited to polish my code, which I plan to do better this week. + +Where the Problem Was +--------------------- +The KDE render basically works rendering the KDE of a point to a texture and summing that texture to the next render. For this to work, +the texture, rendered to a billboard, needs to be the same size of the screen, otherwise the captured texture will include the black background. +The problem I faced with that is that the billboard scaling isn't exactly well defined, so I had to guess for a fixed screen size +(in this example, I worked with 600x600) what scaling value made the billboard fit exactly inside the screen (it's 3.4). That is far from ideal as I +will need to modularize this behavior inside a function that needs to work for every case, so I will need to figure out a way to fix that +for every screen size. For that, I have two options: + +1. Find the scaling factor function that makes the billboard fit into any screen size. +2. Figure out how the scaling works inside the billboard actor to understand if it needs to be refactored. + +The first seems ok to do, but it is kind of a work around as well. The second one is a good general solution, but it is a more delicate one, +as it deals with how the billboard works and already existing applications of it may suffer problems if the scaling is changed. +I will see what is better talking with my mentors. + +Another problem I faced (that is already fixed) relied on shaders. I didn't fully understood how shaders are dealt inside FURY so I was +using my own fragment shader implementation, replacing the already existing one completely. That was working, but I was having an issue +with the texture coordinates of the rendering texture. As I compeltely replaced the fragment shader, I had to pass custom texture coordinates +to the + + +This Week's Goals +----------------- From 8e072b23d749df9d642141e3bfb8936180eba8ea Mon Sep 17 00:00:00 2001 From: Joao Victor Dell Agli Date: Mon, 10 Jul 2023 14:55:47 -0300 Subject: [PATCH 2/4] Finished writing --- .../source/posts/2023/2023-07-10-week-6-joaodellagli.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/source/posts/2023/2023-07-10-week-6-joaodellagli.rst b/docs/source/posts/2023/2023-07-10-week-6-joaodellagli.rst index 26e6fcea9..c50ffb8bd 100644 --- a/docs/source/posts/2023/2023-07-10-week-6-joaodellagli.rst +++ b/docs/source/posts/2023/2023-07-10-week-6-joaodellagli.rst @@ -46,8 +46,15 @@ I will see what is better talking with my mentors. Another problem I faced (that is already fixed) relied on shaders. I didn't fully understood how shaders are dealt inside FURY so I was using my own fragment shader implementation, replacing the already existing one completely. That was working, but I was having an issue with the texture coordinates of the rendering texture. As I compeltely replaced the fragment shader, I had to pass custom texture coordinates -to the +to it, resulting in distorted textures that ruined the calculations. Those issues motivated me to learn the shaders API, which allowed me +to use the right texture coordinates and finally render the results you see above. This Week's Goals ----------------- +For this week, I plan to try a different approach Filipi, one of my mentors, told me to do. This approach was supposed to be the original +one, but a communication failure lead to this path I am currently in. This approach renders each KDE calculation into its own billboard, +and those are rendered together with additive blending. After this first pass, this render is captured into a texture and then rendered to +another big billboard. + +Wish me luck! \ No newline at end of file From f7328eb63da480b924e30c49dc44100b9d46b0c9 Mon Sep 17 00:00:00 2001 From: Joao Victor Dell Agli Date: Mon, 10 Jul 2023 15:23:47 -0300 Subject: [PATCH 3/4] Continued writing --- .../posts/2023/2023-07-10-week-6-joaodellagli.rst | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/source/posts/2023/2023-07-10-week-6-joaodellagli.rst b/docs/source/posts/2023/2023-07-10-week-6-joaodellagli.rst index c50ffb8bd..42d973e2e 100644 --- a/docs/source/posts/2023/2023-07-10-week-6-joaodellagli.rst +++ b/docs/source/posts/2023/2023-07-10-week-6-joaodellagli.rst @@ -14,7 +14,7 @@ What I did Last Week Last week I had the goal to implement KDE rendering to the screen (if you want to understand what this is, check my :doc:`last blogpost <2023-07-03-week-5-joaodellagli>`). After some days diving into the code, I finally managed to do it: -.. image:: +.. image:: https://raw.githubusercontent.com/JoaoDell/gsoc_assets/main/images/buffer_compose.png :align: center :alt: KDE render to a billboard @@ -25,14 +25,14 @@ Also, I reviewed the shader part of Tania's PR `#791 `_ to make it more understandable, as its description still dates back to the time I was using the +flawed Framebuffer implementation, and my fellow GSoC contributors will eventually review it, and to do so, they will need to understand it. + Wish me luck! \ No newline at end of file From 37a90fab78e252d5a15330cc90c2f6d0e3860113 Mon Sep 17 00:00:00 2001 From: Joao Victor Dell Agli Date: Thu, 13 Jul 2023 16:30:11 -0300 Subject: [PATCH 4/4] Minor fix --- docs/source/posts/2023/2023-07-10-week-6-joaodellagli.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/posts/2023/2023-07-10-week-6-joaodellagli.rst b/docs/source/posts/2023/2023-07-10-week-6-joaodellagli.rst index 42d973e2e..e9335c541 100644 --- a/docs/source/posts/2023/2023-07-10-week-6-joaodellagli.rst +++ b/docs/source/posts/2023/2023-07-10-week-6-joaodellagli.rst @@ -11,7 +11,7 @@ Hello everyone, time for a other weekly blogpost! Today, I will show you my curr What I did Last Week -------------------- -Last week I had the goal to implement KDE rendering to the screen (if you want to understand what this is, check my :doc:`last blogpost <2023-07-03-week-5-joaodellagli>`). +Last week I had the goal to implement KDE rendering to the screen (if you want to understand what this is, check my :doc:`last blogpost <2023-07-03-week-5-joaodellagli>`_). After some days diving into the code, I finally managed to do it: .. image:: https://raw.githubusercontent.com/JoaoDell/gsoc_assets/main/images/buffer_compose.png