<div dir="ltr"><div class="gmail_default"><font face="georgia, serif">Hi pq,</font></div><div class="gmail_default"><font face="georgia, serif"><br></font></div><div class="gmail_default"><font face="georgia, serif">Thank you for your response.</font></div><div class="gmail_default"><font face="georgia, serif"><br></font></div><div class="gmail_default"><div class="gmail_default"><font face="georgia, serif">> However, weston_matrix *is* using float instead of double. Is that the</font></div><div class="gmail_default"><font face="georgia, serif">> problem?</font></div></div><div class="gmail_default"><font face="georgia, serif"><br></font></div><div class="gmail_default"><font face="georgia, serif">No. according to your analysis, it does not seem to be the cause of the this</font></div><div class="gmail_default"><font face="georgia, serif">problem.<br></font></div><div class="gmail_default"><font face="georgia, serif"><br></font></div><div class="gmail_default"><div class="gmail_default"><font face="georgia, serif">> During animations and any transformations that apply scaling, it is</font></div><div class="gmail_default"><font face="georgia, serif">> expected that the result has some sampling artifacts. The gl-renderer</font></div><div class="gmail_default"><font face="georgia, serif">> also has some logic to switch between GL_NEAREST and GL_LINEAR</font></div><div class="gmail_default"><font face="georgia, serif">> interpolation. What kind of animation is it that triggers the problem</font></div><div class="gmail_default"><font face="georgia, serif">> for you?</font></div></div><div class="gmail_default"><font face="georgia, serif"><br></font></div><div class="gmail_default"><font face="georgia, serif">When I trace it in gl-renderer, the problem occurs in GL_LINEAR filter.</font></div><div class="gmail_default"><font face="georgia, serif">After changing the logic to GL_NEAREST instead of the GL_LINEAR,</font></div><div class="gmail_default"><font face="georgia, serif">the incorrect drawing of the triangle has disappeared.<br></font></div><div class="gmail_default"><font face="georgia, serif">It seems that there is a problem when interpolation is performed</font></div><div class="gmail_default"><font face="georgia, serif">becauseĀ of fp16 limitation.</font></div><div class="gmail_default"><font face="georgia, serif"><br></font></div><div class="gmail_default"><font face="georgia, serif"><span style="color:rgb(0,0,0);font-size:14px">> In the attached picture, I see not only the triangle you speak of, but</span><br style="color:rgb(0,0,0);font-size:14px"><span style="color:rgb(0,0,0);font-size:14px">> also a color difference at the topmost horizontal bar. Could you share</span><br style="color:rgb(0,0,0);font-size:14px"><span style="color:rgb(0,0,0);font-size:14px">> the original full-resolution captures in the web instead of an</span><br style="color:rgb(0,0,0);font-size:14px"><span style="color:rgb(0,0,0);font-size:14px">> attachment?</span></font></div><div class="gmail_default"><font face="georgia, serif"><br></font></div><div class="gmail_default"><font face="georgia, serif">The error of the color difference seems to be in the form of a triangle.</font></div><div class="gmail_default"><font face="georgia, serif">Please refer to the following link for the captured image.</font></div><div class="gmail_default"><a href="https://www.dropbox.com/s/k0u0bh8vn9vybee/cycleline-error.png?dl=0" target="_blank"><font face="georgia, serif">cycleline-error.png</font></a></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 class="gmail_extra"><br><div class="gmail_quote">2017-11-17 18:56 GMT+09:00 Pekka Paalanen <span dir="ltr"><<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.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="gmail-m_522887509605086338HOEnZb"><div class="gmail-m_522887509605086338h5">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>
> 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 they<br>
> are used. For fp16 values above the 0.5 limit on the texture coordinate the<br>
> fp16 "increment" between values is 2^-11, or about 0.000488. For a texture<br>
> which is 1024 pixels wide this give an sample point accuracy of only +-<br>
> half a pixel width which is insufficient for accurate sampling (especially<br>
> when using GL_LINEAR filtering).<br>
> Short answer: don't do maths on texture coordinates in the fragment shader.<br>
> ---<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>
</div></div>> 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>
<span>> 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 is<br>
> 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 feedback.<br>
<br>
</span>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>
</blockquote></div><br></div></div>