X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fpoint-mesh%2Fpoint-mesh-example.cpp;h=747f07f3b6469588e1027b03e7f80a562f3c5f42;hb=a832af2813558a32f0a18747f3e6134ff6f6f301;hp=80a6ad0e1a43390303c621aa7df0af5133655ed1;hpb=5d4db52cfe19e40ff8eb748c09764d7237556781;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/point-mesh/point-mesh-example.cpp b/examples/point-mesh/point-mesh-example.cpp index 80a6ad0..747f07f 100644 --- a/examples/point-mesh/point-mesh-example.cpp +++ b/examples/point-mesh/point-mesh-example.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,18 +16,18 @@ */ // EXTERNAL INCLUDES +#include // INTERNAL INCLUDES #include "shared/view.h" - -#include +#include "shared/utility.h" using namespace Dali; namespace { -const char* MATERIAL_SAMPLE( DALI_IMAGE_DIR "gallery-small-48.jpg" ); -const char* MATERIAL_SAMPLE2( DALI_IMAGE_DIR "gallery-medium-19.jpg" ); +const char* MATERIAL_SAMPLE( DEMO_IMAGE_DIR "gallery-small-48.jpg" ); +const char* MATERIAL_SAMPLE2( DEMO_IMAGE_DIR "gallery-medium-19.jpg" ); #define MAKE_SHADER(A)#A @@ -37,6 +37,7 @@ attribute highp float aHue; varying mediump vec2 vTexCoord; uniform mediump mat4 uMvpMatrix; uniform mediump vec3 uSize; +uniform mediump float uPointSize; uniform lowp vec4 uFadeColor; varying mediump vec3 vVertexColor; varying mediump float vHue; @@ -51,11 +52,11 @@ vec3 hsv2rgb(vec3 c) void main() { mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0); - vertexPosition.xyz *= uSize; + vertexPosition.xyz *= (uSize-uPointSize); vertexPosition = uMvpMatrix * vertexPosition; - vVertexColor = hsv2rgb( vec3( aHue, 0.6, 0.7 ) ); + vVertexColor = hsv2rgb( vec3( aHue, 0.7, 1.0 ) ); vHue = aHue; - gl_PointSize = 80.0; + gl_PointSize = uPointSize; gl_Position = vertexPosition; } ); @@ -85,10 +86,11 @@ Geometry CreateGeometry() Vertex polyhedraVertexData[numSides]; float angle=0; float sectorAngle = 2.0f * Math::PI / (float) numSides; + for(unsigned int i=0; i