Updating image-view-url.example 58/316958/2
authorDavid Steele <david.steele@samsung.com>
Thu, 19 Dec 2024 17:42:49 +0000 (17:42 +0000)
committerDavid Steele <david.steele@samsung.com>
Mon, 13 Jan 2025 17:10:14 +0000 (17:10 +0000)
Change-Id: Ic5ab67ba2ab3846491597625fefe971ba4da6ba7

examples/image-view-url/image-view-url-example.cpp
examples/image-view-url/shaders/image-view-url.frag

index d3f1038d827010cb3a27f0d382448d05ad27d30f..1479ead69c34efcfb4507fdf2a75fc24930c5cd3 100644 (file)
@@ -34,7 +34,7 @@ const char* const BUTTON_ICON_SELECTED(DEMO_IMAGE_DIR "icon-change-selected.png"
 
 const char* DELTA_UNIFORM_NAME = "uDelta";
 
-const Vector2 TARGET_SIZE(800.f, 800.f);
+const Vector2 TARGET_SIZE(600.f, 600.f);
 } // namespace
 
 class ImageViewUrlApp : public ConnectionTracker
@@ -126,7 +126,7 @@ private:
       renderTask.SetCameraActor(cameraActor);
 
       mOutputTexture   = Texture::New(TextureType::TEXTURE_2D,
-                                    Pixel::RGB888,
+                                    Pixel::RGBA8888,
                                     unsigned(TARGET_SIZE.width),
                                     unsigned(TARGET_SIZE.height));
       auto framebuffer = FrameBuffer::New(TARGET_SIZE.width, TARGET_SIZE.height, FrameBuffer::Attachment::NONE);
index 27bbc1891fedfdbbde435c4c638d49df4efe43e5..961891df1b05da1f058af56e92106b57265cf032 100644 (file)
@@ -1,7 +1,12 @@
+//@version 100
+
 precision highp float;
 INPUT mediump vec2 vTexCoord;
-uniform sampler2D sTexture;
-uniform mediump float uDelta;
+UNIFORM sampler2D sTexture;
+UNIFORM_BLOCK FragBlock
+{
+UNIFORM mediump float uDelta;
+};
 
 void main()
 {
@@ -10,5 +15,5 @@ void main()
   mat2 rotation = mat2(cos(uDelta), -sin(uDelta), sin(uDelta), cos(uDelta));
   texCoord = (rotation * texCoord) * .5 + .5;
   color += TEXTURE( sTexture, texCoord );
-  OUT_COLOR = color;
+  gl_FragColor = color;
 }