After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 737505 - gltestsrc: implement checkers pattern in GLSL
gltestsrc: implement checkers pattern in GLSL
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-09-28 03:01 UTC by comicfans44
Modified: 2014-10-07 12:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to implement checkers pattern in GLSL (8.96 KB, patch)
2014-09-28 03:01 UTC, comicfans44
needs-work Details | Review
v2 fix inconsist bug (8.98 KB, patch)
2014-09-29 07:48 UTC, comicfans44
reviewed Details | Review
v3 fix glsl compliant (9.00 KB, patch)
2014-09-29 23:50 UTC, comicfans44
committed Details | Review

Description comicfans44 2014-09-28 03:01:50 UTC
Created attachment 287268 [details] [review]
patch to implement checkers pattern in GLSL

seems that gltestsrc comments out the checkers pattern 
which based on line by line drawing, this patch implements 
checkers pattern in GLSL. for common usage, 
I moved the position/mvp variable to static.
Comment 1 Matthew Waters (ystreet00) 2014-09-28 12:28:15 UTC
Review of attachment 287268 [details] [review]:

This seems to have blocks that are twice the size of the videotestsrc ones.

Also, this is black/white whereas videotestsrc works on red/green.

gltestsrc pattern=checkers-8 ! glvideomixer ! glimagesink seems to produce weird artifacts when used together.  Probably because you're not writing to the alpha channel in the shader.

There is also the checker shader in glvideomixer if you want to use it.
Comment 2 comicfans44 2014-09-29 07:48:02 UTC
Created attachment 287321 [details] [review]
v2 fix inconsist bug

(In reply to comment #1)
> Review of attachment 287268 [details] [review]:
> 
> This seems to have blocks that are twice the size of the videotestsrc ones.
> 
> Also, this is black/white whereas videotestsrc works on red/green.

sorry for the inconsist bug, I'm not sure if this is suitable implementation, so just did a quick hack ...

> 
> gltestsrc pattern=checkers-8 ! glvideomixer ! glimagesink seems to produce
> weird artifacts when used together.  Probably because you're not writing to the
> alpha channel in the shader.
> 
fixed 

> There is also the checker shader in glvideomixer if you want to use it.
I'm not sure whether to use it , since conditional statement in shader may hit some old hardware performance(I didn't test it ,maybe doesn't matter )
Comment 3 Matthew Waters (ystreet00) 2014-09-29 08:28:08 UTC
Review of attachment 287321 [details] [review]:

One small issue :)

::: ext/gl/gstgltestsrc.c
@@ +317,3 @@
+	  float result=mod(xy_mod.x+xy_mod.y,2.0); \
+	  gl_FragColor.r=step(result,0.5); \
+	  gl_FragColor.g=1-gl_FragColor.r; \

'1-gl_FragColor.r' is not glsl spec compliant and the mesa shader compiler fails with it.

You need to do '1.0-gl_FragColor.r' instead.
Comment 4 comicfans44 2014-09-29 23:50:13 UTC
Created attachment 287409 [details] [review]
v3 fix glsl compliant 

(In reply to comment #3)
> Review of attachment 287321 [details] [review]:
> 
> One small issue :)
> 
> ::: ext/gl/gstgltestsrc.c
> @@ +317,3 @@
> +      float result=mod(xy_mod.x+xy_mod.y,2.0); \
> +      gl_FragColor.r=step(result,0.5); \
> +      gl_FragColor.g=1-gl_FragColor.r; \
> 
> '1-gl_FragColor.r' is not glsl spec compliant and the mesa shader compiler
> fails with it.
> 
> You need to do '1.0-gl_FragColor.r' instead.
fixed, also fix the 'Tab' indent
Comment 5 Matthew Waters (ystreet00) 2014-10-07 12:42:39 UTC
commit 2c293b4f61a1495cda2f8ddf2c6096739f7e5fad
Author: Wang Xin-yu (王昕宇) <comicfans44@gmail.com>
Date:   Sun Sep 28 10:51:09 2014 +0800

    gltestsrc: implement checkers pattern with GLSL
    
    https://bugzilla.gnome.org/show_bug.cgi?id=737505