<div dir="ltr">Hi,<div><br></div><div>If you're worried about FP16 interpolation accuracy (which, as the vendor states, only gets you 10 bits of accuracy, so only 1024 different values -- definitely not big enough to drive a maximized window at normal desktop resolutions), you can try using normalized GL_SHORT texture coordinates instead. I don't know if the hardware you have supports fixed-point interpolation for vertex attributes, you would need to ask your vendor about that. You can also try changing the "precision mediump"s in gl-renderer.c to "precision highp"s. I would hope a decent GPU would support at least FP32.<div><br></div><div>Anything else would require extensive changes to either use texelFetch or rectangle textures, both of which are things you likely don't want to do.</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 21, 2017 at 12:08 AM, YoungJun Jo <span dir="ltr"><<a href="mailto:dtoartist@gmail.com" target="_blank">dtoartist@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default"><font face="georgia, serif">Hi,</font></div><div class="gmail_default"><font face="georgia, serif"><br></font></div><div class="gmail_default"><font face="georgia, serif">The uploaded image was not capture using the camera or mobile phone.</font></div><div class="gmail_default"><font face="georgia, serif">I captured image using the screenshot program.</font></div><div class="gmail_default"><font face="georgia, serif">So that's not related display signals or illusion or the human vision.</font></div><div class="gmail_default"><font face="georgia, serif">The triangle error is shown in the top-right area when you see the image</font></div><div class="gmail_default"><font face="georgia, serif">with the original image state of 100% without scaling, that is 1280*720 size.<br></font></div><div class="gmail_default"><font face="georgia, serif">Download image and open with your program, do not resize.</font></div><div class="gmail_default"><font face="georgia, serif"><br></font></div><div class="gmail_default"><font face="georgia, serif">As mentioned in the previous mail, c<font style="color:rgb(0,0,0)">hanging the logic to from GL_LINEAR</font></font></div><div class="gmail_default"><font face="georgia, serif"><font style="color:rgb(0,0,0)">to GL_NEAREST in </font><font color="#000000"><i>draw_view()</i> function, </font><span style="color:rgb(0,0,0)">the incorrect drawing</span></font></div><div class="gmail_default"><font face="georgia, serif"><span style="color:rgb(0,0,0)">of the triangle has disappeared. </span><span style="color:rgb(0,0,0)">I have done the tests using pixman render,</span></font></div><div class="gmail_default"><font face="georgia, serif"><span style="color:rgb(0,0,0)">so all RGB data values </span><span style="color:rgb(0,0,0)">are exactly the same.</span></font></div><div class="gmail_default"><div class="gmail_default"><font face="georgia, serif"><font color="#000000">I would like to know that this is related to the GPU's fragment shader fp16 constraint.</font><br></font></div><div class="gmail_default" style="color:rgb(0,0,0)"><font face="georgia, serif"><br></font></div></div><div class="gmail_default"><font face="georgia, serif">I linked the original image, error image and my analysis as shown below.<br></font></div><div class="gmail_default"><a href="https://www.dropbox.com/s/pldq7z4qnxn7kmn/CycleLineImage.png?dl=0" target="_blank"><font face="georgia, serif">original-image</font></a></div><div class="gmail_default"><a href="https://www.dropbox.com/s/xq7qtvxn7ejrirj/CycleLineImage_shot_screen.png?dl=0" target="_blank"><font face="georgia, serif">error-image</font></a></div><div class="gmail_default"><font face="georgia, serif"><a href="https://www.dropbox.com/s/dgxluifv10j8zh7/CycleLineImage%20from_0_to_90line_20170919.xlsx?dl=0" target="_blank">analysis excel file</a></font></div><div class="gmail_default"><font face="georgia, serif"><br></font></div><div class="gmail_default"><font face="georgia, serif">If you think that this issue is not related to weston, you can ignore it:-)<br></font></div><div class="gmail_default"><font face="georgia, serif"><br></font></div><div class="gmail_default"><font face="georgia, serif">Regards,</font></div><div class="gmail_default"><font face="georgia, serif">yj</font></div><div><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2017-11-20 20:30 GMT+09:00 Christian Stroetmann <span dir="ltr"><<a href="mailto:stroetmann@ontolab.com" target="_blank">stroetmann@ontolab.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_6882976793451607174gmail-m_-4677139762817886268m_-3540484589652698841m_-2116042569876415165gmail-m_4687946966741060202m_386202343519758542HOEnZb"><div class="m_6882976793451607174gmail-m_-4677139762817886268m_-3540484589652698841m_-2116042569876415165gmail-m_4687946966741060202m_386202343519758542h5">Am 20.11.2017 09:08, schrieb Pekka Paalanen:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
On Sat, 18 Nov 2017 20:42:44 +0900<br>
YoungJun Jo<<a href="mailto:dtoartist@gmail.com" target="_blank">dtoartist@gmail.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hi pq,<br>
<br>
Thank you for your response.<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
However, weston_matrix *is* using float instead of double. Is that the<br>
problem?<br>
</blockquote>
No. according to your analysis, it does not seem to be the cause of the this<br>
problem.<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
During animations and any transformations that apply scaling, it is<br>
expected that the result has some sampling artifacts. The gl-renderer<br>
also has some logic to switch between GL_NEAREST and GL_LINEAR<br>
interpolation. What kind of animation is it that triggers the problem<br>
for you?<br>
</blockquote>
When I trace it in gl-renderer, the problem occurs in GL_LINEAR filter.<br>
After changing the logic to GL_NEAREST instead of the GL_LINEAR,<br>
the incorrect drawing of the triangle has disappeared.<br>
It seems that there is a problem when interpolation is performed<br>
because of fp16 limitation.<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
In the attached picture, I see not only the triangle you speak of, but<br>
also a color difference at the topmost horizontal bar. Could you share<br>
the original full-resolution captures in the web instead of an<br>
attachment?<br>
</blockquote>
The error of the color difference seems to be in the form of a triangle.<br>
Please refer to the following link for the captured image.<br>
cycleline-error.png<br>
<<a href="https://www.dropbox.com/s/k0u0bh8vn9vybee/cycleline-error.png?dl=0" rel="noreferrer" target="_blank">https://www.dropbox.com/s/k0u<wbr>0bh8vn9vybee/cycleline-error.p<wbr>ng?dl=0</a>><br>
<br>
</blockquote>
Hi,<br>
<br>
that is a very interesting image indeed. Is this really the captured<br>
image with the rendering problem?<br>
<br>
If I look at it at 100% or 700% scaling in firefox, I cannot see<br>
anything wrong in it.<br>
<br>
However, if I look at it at 300% and scroll it sideways, I do see the<br>
strange triangle of the top row, and I also see another vertical "edge"<br>
on the same row somewhat past the midpoint. I don't see them if the<br>
image stationary.<br>
<br>
If I look at it at 200% and squint, I can vaguely see the triangle and<br>
the "edge".<br>
<br>
I also tried 'xmag' of the area where I do see the triangle, and the<br>
magnification does not have it.<br>
<br>
Therefore, I don't think this is a misrendering but some other effect<br>
in the display signal, the monitor device, or even human vision.<br>
<br>
I don't know what to do about it.<br>
<br>
<br>
Thanks,<br>
pq<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Regards,<br>
yj<br>
<br>
2017-11-17 18:56 GMT+09:00 Pekka Paalanen<<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>>:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
On Fri, 17 Nov 2017 17:30:47 +0900<br>
YoungJun Jo<<a href="mailto:dtoartist@gmail.com" target="_blank">dtoartist@gmail.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Dear all,<br>
<br>
In the weston environment, there is a problem when displaying a specific<br>
image using the GPU(Fragment Shader(FS) only supports FP16).<br>
In fact, I think it's not common case to use a GPU with FS of FP16<br>
constraints in a desktop environment, so I was worried about asking<br>
question.<br>
<br>
The specific image which the error occurs is an image with black vertical<br>
lines and white vertical lines arranged at 1 pixel intervals.<br>
I modified the weston-image code to display fullscreen to better observe<br>
where the error occurred.<br>
<br>
When I display the image on the screen, I get a triangle-shaped wrong<br>
drawing during the time of the fade animation in the top-right part.<br>
(Please refer to attachment 'cycleline-error.png')<br>
<br>
First, I contacted the GPU vendor about this issue and got the following<br>
answer:<br>
---<br>
I'm pretty sure the issue is that your texture coordinates are being<br>
converted to fp16 because arithmetic is being performed on them before<br>
</blockquote>
they<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
are used. For fp16 values above the 0.5 limit on the texture coordinate<br>
</blockquote>
the<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
fp16 "increment" between values is 2^-11, or about 0.000488. For a<br>
</blockquote>
texture<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
which is 1024 pixels wide this give an sample point accuracy of only +-<br>
half a pixel width which is insufficient for accurate sampling<br>
</blockquote>
(especially<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
when using GL_LINEAR filtering).<br>
Short answer: don't do maths on texture coordinates in the fragment<br>
</blockquote>
shader.<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
Based on the above answer, I would like to confirm whether the exception<br>
handling is appropriate for animation in the condition that FS is FP16 in<br>
weston's gl-renderer.<br>
In addition, I have found one way to prevent such incorrect rendering.<br>
When i remove the *weston_matrix_init(&animation<wbr>->transform.matrix)* in<br>
*weston_view_animation_create(<wbr>)* function;, The error does not occur and<br>
the animation effect is shown.<br>
In Android(I do not know if it is appropriate to compare), since there is<br>
no matrix operation during animation, wrong drawing does not occur.<br>
So I would like to know whether the matrix operation in weston animation<br>
</blockquote>
is<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
necessary or can be removed.<br>
Or is there another good way to avoid the above precision errors?<br>
<br>
My debugging and analysis may be wrong, so I would appreciate any<br>
</blockquote>
feedback.<br>
<br>
Hi,<br>
<br>
weston's vertex or fragment shaders do not do any computations on the<br>
texture coordinates, so I am confused about saying it's about the<br>
shaders.<br>
<br>
Commenting out a call to weston_matrix_init() does not prevent the<br>
matrix from being used. It will only cause the matrix to be used<br>
uninitialized.<br>
<br>
However, weston_matrix *is* using float instead of double. Is that the<br>
problem?<br>
<br>
During animations and any transformations that apply scaling, it is<br>
expected that the result has some sampling artifacts. The gl-renderer<br>
also has some logic to switch between GL_NEAREST and GL_LINEAR<br>
interpolation. What kind of animation is it that triggers the problem<br>
for you?<br>
<br>
In the attached picture, I see not only the triangle you speak of, but<br>
also a color difference at the topmost horizontal bar. Could you share<br>
the original full-resolution captures in the web instead of an<br>
attachment?<br>
<br>
<br>
Thanks,<br>
pq<br>
<br>
</blockquote></blockquote></blockquote>
<br></div></div>
Hello<br>
<br>
I also looked at the image in a Firefox webbrowser but got different effects:<br>
I got no triangle in any scale.<br>
When I scale down then in one scale only the 4th bar got a white or grey between the black lines become a little green and in the next smaller scale the same happens only with the 5th bar.<br>
When I scale up then some areas where the black and white lines touch each other I get a little green, red, or blue. These are the areas where a grey color is mixed.<br>
<br>
So it seems to be that it is an effect of the display raster, but it could also be an illusion that tricks out the human vision when the eyes move over a specific line with the right size of the black and white lines respectively pattern.<br>
<br>
<br>
<br>
Best Regards<span class="m_6882976793451607174gmail-m_-4677139762817886268m_-3540484589652698841m_-2116042569876415165gmail-m_4687946966741060202m_386202343519758542HOEnZb"><font color="#888888"><br>
Christian Stroetmann<br>
<br>
<br>
</font></span></blockquote></div><br></div></div></div></div>
<br>______________________________<wbr>_________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.<wbr>freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/wayland-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/wayland-devel</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"> Jasper<br></div>
</div>