¡@

Home 

2014/10/16 ¤W¤È 08:23:49

android Programming Glossary: shader

Is Google's Android OpenGL tutorial teaching incorrect linear algebra?

http://stackoverflow.com/questions/11925647/is-googles-android-opengl-tutorial-teaching-incorrect-linear-algebra

mMVPMatrixHandle 1 false mvpMatrix 0 Finally in their shader a vector matrix multiplication the matrix must be included as.. is incorrect. Specifically the order of the factors in the shader code should be reversed gl_Position uMVPMatrix vPosition As..

Modifying camera output using SurfaceTexture and OpenGL

http://stackoverflow.com/questions/12519235/modifying-camera-output-using-surfacetexture-and-opengl

create a DirectVideo draw object which compiles links the shaders defined and adds them to an openGL program. It then creates.. width height static public int loadShader int type String shaderCode int shader GLES20.glCreateShader type GLES20.glShaderSource.. public int loadShader int type String shaderCode int shader GLES20.glCreateShader type GLES20.glShaderSource shader shaderCode..

How To Get File In Assets From Android NDK

http://stackoverflow.com/questions/13317387/how-to-get-file-in-assets-from-android-ndk

I am also using OSG. I set the image as a texture to my shader with the following code texture setImage osgDB readImageFile..

create circular image view in android [duplicate]

http://stackoverflow.com/questions/16208365/create-circular-image-view-in-android

bitmap.getHeight Bitmap.Config.ARGB_8888 BitmapShader shader new BitmapShader bitmap TileMode.CLAMP TileMode.CLAMP Paint.. TileMode.CLAMP Paint paint new Paint paint.setShader shader Canvas c new Canvas circleBitmap c.drawCircle bitmap.getWidth..

Gradient appears banded in a SurfaceView, but looks very smooth in a normal View

http://stackoverflow.com/questions/7774867/gradient-appears-banded-in-a-surfaceview-but-looks-very-smooth-in-a-normal-view

paint.setFilterBitmap false paint.setDither false Shader shader new LinearGradient 0 0 0 200 new int 0xff150d2f 0xff432b96 null.. 0xff432b96 null Shader.TileMode.CLAMP paint.setShader shader canvas.drawRect 0 0 getWidth getHeight paint Here is the screenshot..

Android Camera will not work. startPreview fails

http://stackoverflow.com/questions/7942378/android-camera-will-not-work-startpreview-fails

readFile fragment.fsh catch IOException e Debug.out The shaders could not be found. e.printStackTrace mProgram GLES20.glCreateProgram.. GLES20.glAttachShader mProgram vertexShader add the vertex shader to program GLES20.glAttachShader mProgram fragmentShader add.. mProgram fragmentShader add the fragment shader to program GLES20.glLinkProgram mProgram creates OpenGL program..

Modifying camera output using SurfaceTexture and OpenGL

http://stackoverflow.com/questions/12519235/modifying-camera-output-using-surfacetexture-and-opengl

GLES20.glViewport 0 0 width height static public int loadShader int type String shaderCode int shader GLES20.glCreateShader.. int type String shaderCode int shader GLES20.glCreateShader type GLES20.glShaderSource shader shaderCode GLES20.glCompileShader.. shaderCode int shader GLES20.glCreateShader type GLES20.glShaderSource shader shaderCode GLES20.glCompileShader shader return..

Android color picker to be included in the activity

http://stackoverflow.com/questions/16363235/android-color-picker-to-be-included-in-the-activity

0xFF0000FF 0xFF00FFFF 0xFF00FF00 0xFFFFFF00 0xFFFF0000 Shader s new SweepGradient 0 0 mColors null mPaint new Paint Paint.ANTI_ALIAS_FLAG.. null mPaint new Paint Paint.ANTI_ALIAS_FLAG mPaint.setShader s mPaint.setStyle Paint.Style.STROKE mPaint.setStrokeWidth 32..

Draw in Canvas by finger android

http://stackoverflow.com/questions/16650419/draw-in-canvas-by-finger-android

0xFF0000FF 0xFF00FFFF 0xFF00FF00 0xFFFFFF00 0xFFFF0000 Shader s new SweepGradient 0 0 mColors null mPaint new Paint Paint.ANTI_ALIAS_FLAG.. null mPaint new Paint Paint.ANTI_ALIAS_FLAG mPaint.setShader s mPaint.setStyle Paint.Style.STROKE mPaint.setStrokeWidth 32..

Android Null Exception on Calling function

http://stackoverflow.com/questions/17781069/android-null-exception-on-calling-function

0xFF0000FF 0xFF00FFFF 0xFF00FF00 0xFFFFFF00 0xFFFF0000 Shader s new SweepGradient 0 0 mColors null mPaint new Paint Paint.ANTI_ALIAS_FLAG.. null mPaint new Paint Paint.ANTI_ALIAS_FLAG mPaint.setShader s mPaint.setStyle Paint.Style.STROKE mPaint.setStrokeWidth 32..

Trying to draw a button: how to set a stroke color and how to “align” a gradient to the bottom without knowing the height?

http://stackoverflow.com/questions/2145131/trying-to-draw-a-button-how-to-set-a-stroke-color-and-how-to-align-a-gradient

the gradient aligned to the bottom of the button. final Shader shader new LinearGradient 0 0 0 30 new int color_1 color_2 null.. new LinearGradient 0 0 0 30 new int color_1 color_2 null Shader.TileMode.MIRROR float roundedCorner new float 5 5 5 5 5 5 5.. RoundRectShape roundedCorner null null normal.getPaint .setShader shader normal.setPadding 7 3 7 5 Create a state list I suppressed..

Text with gradient in Android

http://stackoverflow.com/questions/2680607/text-with-gradient-in-android

this question TextView secondTextView new TextView this Shader textShader new LinearGradient 0 0 0 20 new int Color.GREEN Color.BLUE.. TextView secondTextView new TextView this Shader textShader new LinearGradient 0 0 0 20 new int Color.GREEN Color.BLUE new..

Multi-gradient shapes

http://stackoverflow.com/questions/4381033/multi-gradient-shapes

here that looks like it'd be a great help ShapeDrawable.ShaderFactory sf new ShapeDrawable.ShaderFactory @Override public Shader.. help ShapeDrawable.ShaderFactory sf new ShapeDrawable.ShaderFactory @Override public Shader resize int width int height LinearGradient.. sf new ShapeDrawable.ShaderFactory @Override public Shader resize int width int height LinearGradient lg new LinearGradient..

Shader for Android OpenGL ES

http://stackoverflow.com/questions/4850025/shader-for-android-opengl-es

for Android OpenGL ES Is it possible to use vertex or pixel.. String vertexSource String fragmentSource int vertexShader loadShader GLES20.GL_VERTEX_SHADER vertexSource int pixelShader.. vertexSource String fragmentSource int vertexShader loadShader GLES20.GL_VERTEX_SHADER vertexSource int pixelShader loadShader..

Enable hardware acceleration in Android app, targeting Honeycomb AND prior versions

http://stackoverflow.com/questions/5158824/enable-hardware-acceleration-in-android-app-targeting-honeycomb-and-prior-versi

most operations in Canvas Paint Xfermode ColorFilter Shader and Camera are accelerated. This results in smoother animations..

Android: Shader behave different in 'onDraw(canvas)' and 'new Canvas(bitmap)'

http://stackoverflow.com/questions/5231260/android-shader-behave-different-in-ondrawcanvas-and-new-canvasbitmap

Shader behave different in 'onDraw canvas ' and 'new Canvas bitmap.. 2 0x7FFFFFFF 0x00FFFFFF TileMode.CLAMP paint2.setShader shader paint2.setXfermode new PorterDuffXfermode android.graphics.PorterDuff.Mode.DST_IN.. 2 0x7FFFFFFF 0x00FFFFFF TileMode.CLAMP paint2.setShader shader paint2.setXfermode new PorterDuffXfermode android.graphics.PorterDuff.Mode.DST_IN..

How do the pieces of Android's (2D) Canvas drawing pipeline fit together?

http://stackoverflow.com/questions/5762727/how-do-the-pieces-of-androids-2d-canvas-drawing-pipeline-fit-together

drawing pipeline fit together. For example how do XferMode Shader MaskFilter and ColorFilter interact The reference docs for these.. mask before it is colorized and drawn e.g. blur emboss SkShader e.g. gradients linear radial sweep bitmap patterns clamp repeat.. intrinsic color instead The source colors come from the Shader . In drawBitmap the Shader is temporarily replaced by a BitmapShader..

Gradient appears banded in a SurfaceView, but looks very smooth in a normal View

http://stackoverflow.com/questions/7774867/gradient-appears-banded-in-a-surfaceview-but-looks-very-smooth-in-a-normal-view

false paint.setFilterBitmap false paint.setDither false Shader shader new LinearGradient 0 0 0 200 new int 0xff150d2f 0xff432b96.. 0 0 0 200 new int 0xff150d2f 0xff432b96 null Shader.TileMode.CLAMP paint.setShader shader canvas.drawRect 0 0 getWidth.. 0xff150d2f 0xff432b96 null Shader.TileMode.CLAMP paint.setShader shader canvas.drawRect 0 0 getWidth getHeight paint Here is..

ImageView with rounded corners and inner shadow

http://stackoverflow.com/questions/9469748/imageview-with-rounded-corners-and-inner-shadow

0xFF000000 canvas.drawRoundRect frame radius radius mPaint Shader bitmapShader new BitmapShader mBitmap TileMode.CLAMP TileMode.CLAMP.. frame radius radius mPaint Shader bitmapShader new BitmapShader mBitmap TileMode.CLAMP TileMode.CLAMP mPaint.. frame radius radius mPaint Shader bitmapShader new BitmapShader mBitmap TileMode.CLAMP TileMode.CLAMP mPaint new Paint Paint.ANTI_ALIAS_FLAG..

Is Google's Android OpenGL tutorial teaching incorrect linear algebra?

http://stackoverflow.com/questions/11925647/is-googles-android-opengl-tutorial-teaching-incorrect-linear-algebra

0 Uploading in non transposed order. GLES20.glUniformMatrix4fv mMVPMatrixHandle 1 false mvpMatrix 0 Finally in their shader a vector matrix multiplication the matrix must be included as a modifier of gl_Position gl_Position vPosition uMVPMatrix.. that OpenGL tutorial I can confirm that the example code is incorrect. Specifically the order of the factors in the shader code should be reversed gl_Position uMVPMatrix vPosition As to the application of the rotation matrix the order of the factors..

Modifying camera output using SurfaceTexture and OpenGL

http://stackoverflow.com/questions/12519235/modifying-camera-output-using-surfacetexture-and-opengl

initializing this completion event triggers the renderer to create a DirectVideo draw object which compiles links the shaders defined and adds them to an openGL program. It then creates a new openGL texture object and then calls back to the MainActivity.. GL10 unused int width int height GLES20.glViewport 0 0 width height static public int loadShader int type String shaderCode int shader GLES20.glCreateShader type GLES20.glShaderSource shader shaderCode GLES20.glCompileShader shader return.. int width int height GLES20.glViewport 0 0 width height static public int loadShader int type String shaderCode int shader GLES20.glCreateShader type GLES20.glShaderSource shader shaderCode GLES20.glCompileShader shader return shader static private..

How To Get File In Assets From Android NDK

http://stackoverflow.com/questions/13317387/how-to-get-file-in-assets-from-android-ndk

ANDROID_LOG_DEBUG Debug filename AAssetDir_close assetDir I am also using OSG. I set the image as a texture to my shader with the following code texture setImage osgDB readImageFile fileNameWithPath But that file name must include the absolute..

create circular image view in android [duplicate]

http://stackoverflow.com/questions/16208365/create-circular-image-view-in-android

code Bitmap circleBitmap Bitmap.createBitmap bitmap.getWidth bitmap.getHeight Bitmap.Config.ARGB_8888 BitmapShader shader new BitmapShader bitmap TileMode.CLAMP TileMode.CLAMP Paint paint new Paint paint.setShader shader Canvas c new Canvas.. BitmapShader shader new BitmapShader bitmap TileMode.CLAMP TileMode.CLAMP Paint paint new Paint paint.setShader shader Canvas c new Canvas circleBitmap c.drawCircle bitmap.getWidth 2 bitmap.getHeight 2 bitmap.getWidth 2 paint imageView.setImageBitmap..

Gradient appears banded in a SurfaceView, but looks very smooth in a normal View

http://stackoverflow.com/questions/7774867/gradient-appears-banded-in-a-surfaceview-but-looks-very-smooth-in-a-normal-view

paint.setStyle Paint.Style.FILL paint.setAntiAlias false paint.setFilterBitmap false paint.setDither false Shader shader new LinearGradient 0 0 0 200 new int 0xff150d2f 0xff432b96 null Shader.TileMode.CLAMP paint.setShader shader canvas.drawRect.. Shader shader new LinearGradient 0 0 0 200 new int 0xff150d2f 0xff432b96 null Shader.TileMode.CLAMP paint.setShader shader canvas.drawRect 0 0 getWidth getHeight paint Here is the screenshot showing the SurfaceView above and the normal View beneath...

Android Camera will not work. startPreview fails

http://stackoverflow.com/questions/7942378/android-camera-will-not-work-startpreview-fails

fragmentShader loadShader GLES20.GL_FRAGMENT_SHADER readFile fragment.fsh catch IOException e Debug.out The shaders could not be found. e.printStackTrace mProgram GLES20.glCreateProgram create empty OpenGL Program GLES20.glAttachShader.. GLES20.glCreateProgram create empty OpenGL Program GLES20.glAttachShader mProgram vertexShader add the vertex shader to program GLES20.glAttachShader mProgram fragmentShader add the fragment shader to program GLES20.glLinkProgram mProgram.. mProgram vertexShader add the vertex shader to program GLES20.glAttachShader mProgram fragmentShader add the fragment shader to program GLES20.glLinkProgram mProgram creates OpenGL program executables get handles maPositionHandle GLES20.glGetAttribLocation..

Modifying camera output using SurfaceTexture and OpenGL

http://stackoverflow.com/questions/12519235/modifying-camera-output-using-surfacetexture-and-opengl

void onSurfaceChanged GL10 unused int width int height GLES20.glViewport 0 0 width height static public int loadShader int type String shaderCode int shader GLES20.glCreateShader type GLES20.glShaderSource shader shaderCode GLES20.glCompileShader.. GLES20.glViewport 0 0 width height static public int loadShader int type String shaderCode int shader GLES20.glCreateShader type GLES20.glShaderSource shader shaderCode GLES20.glCompileShader shader return shader static private int createTexture.. 0 width height static public int loadShader int type String shaderCode int shader GLES20.glCreateShader type GLES20.glShaderSource shader shaderCode GLES20.glCompileShader shader return shader static private int createTexture int texture new int..

Android color picker to be included in the activity

http://stackoverflow.com/questions/16363235/android-color-picker-to-be-included-in-the-activity

super c mListener l mColors new int 0xFFFF0000 0xFFFF00FF 0xFF0000FF 0xFF00FFFF 0xFF00FF00 0xFFFFFF00 0xFFFF0000 Shader s new SweepGradient 0 0 mColors null mPaint new Paint Paint.ANTI_ALIAS_FLAG mPaint.setShader s mPaint.setStyle Paint.Style.STROKE.. 0xFFFFFF00 0xFFFF0000 Shader s new SweepGradient 0 0 mColors null mPaint new Paint Paint.ANTI_ALIAS_FLAG mPaint.setShader s mPaint.setStyle Paint.Style.STROKE mPaint.setStrokeWidth 32 mCenterPaint new Paint Paint.ANTI_ALIAS_FLAG mCenterPaint.setColor..

Draw in Canvas by finger android

http://stackoverflow.com/questions/16650419/draw-in-canvas-by-finger-android

super c mListener l mColors new int 0xFFFF0000 0xFFFF00FF 0xFF0000FF 0xFF00FFFF 0xFF00FF00 0xFFFFFF00 0xFFFF0000 Shader s new SweepGradient 0 0 mColors null mPaint new Paint Paint.ANTI_ALIAS_FLAG mPaint.setShader s mPaint.setStyle Paint.Style.STROKE.. 0xFFFFFF00 0xFFFF0000 Shader s new SweepGradient 0 0 mColors null mPaint new Paint Paint.ANTI_ALIAS_FLAG mPaint.setShader s mPaint.setStyle Paint.Style.STROKE mPaint.setStrokeWidth 32 mCenterPaint new Paint Paint.ANTI_ALIAS_FLAG mCenterPaint.setColor..

Android Null Exception on Calling function

http://stackoverflow.com/questions/17781069/android-null-exception-on-calling-function

super c mListener l mColors new int 0xFFFF0000 0xFFFF00FF 0xFF0000FF 0xFF00FFFF 0xFF00FF00 0xFFFFFF00 0xFFFF0000 Shader s new SweepGradient 0 0 mColors null mPaint new Paint Paint.ANTI_ALIAS_FLAG mPaint.setShader s mPaint.setStyle Paint.Style.STROKE.. 0xFFFFFF00 0xFFFF0000 Shader s new SweepGradient 0 0 mColors null mPaint new Paint Paint.ANTI_ALIAS_FLAG mPaint.setShader s mPaint.setStyle Paint.Style.STROKE mPaint.setStrokeWidth 32 mCenterPaint new Paint Paint.ANTI_ALIAS_FLAG mCenterPaint.setColor..

Trying to draw a button: how to set a stroke color and how to “align” a gradient to the bottom without knowing the height?

http://stackoverflow.com/questions/2145131/trying-to-draw-a-button-how-to-set-a-stroke-color-and-how-to-align-a-gradient

to 30 I don't know the height beforehand . I wish I could set the gradient aligned to the bottom of the button. final Shader shader new LinearGradient 0 0 0 30 new int color_1 color_2 null Shader.TileMode.MIRROR float roundedCorner new float 5 5.. aligned to the bottom of the button. final Shader shader new LinearGradient 0 0 0 30 new int color_1 color_2 null Shader.TileMode.MIRROR float roundedCorner new float 5 5 5 5 5 5 5 5 ShapeDrawable normal new ShapeDrawable new RoundRectShape.. 5 5 5 5 5 5 5 5 ShapeDrawable normal new ShapeDrawable new RoundRectShape roundedCorner null null normal.getPaint .setShader shader normal.setPadding 7 3 7 5 Create a state list I suppressed settings for pressed . StateListDrawable state_list new..

Text with gradient in Android

http://stackoverflow.com/questions/2680607/text-with-gradient-in-android

a gradient effect android user interface share improve this question TextView secondTextView new TextView this Shader textShader new LinearGradient 0 0 0 20 new int Color.GREEN Color.BLUE new float 0 1 TileMode.CLAMP secondTextView.getPaint.. effect android user interface share improve this question TextView secondTextView new TextView this Shader textShader new LinearGradient 0 0 0 20 new int Color.GREEN Color.BLUE new float 0 1 TileMode.CLAMP secondTextView.getPaint .setShader..

Multi-gradient shapes

http://stackoverflow.com/questions/4381033/multi-gradient-shapes

at least not in Android but I've found a good solution posted here that looks like it'd be a great help ShapeDrawable.ShaderFactory sf new ShapeDrawable.ShaderFactory @Override public Shader resize int width int height LinearGradient lg new LinearGradient.. a good solution posted here that looks like it'd be a great help ShapeDrawable.ShaderFactory sf new ShapeDrawable.ShaderFactory @Override public Shader resize int width int height LinearGradient lg new LinearGradient 0 0 width height new int.. that looks like it'd be a great help ShapeDrawable.ShaderFactory sf new ShapeDrawable.ShaderFactory @Override public Shader resize int width int height LinearGradient lg new LinearGradient 0 0 width height new int Color.GREEN Color.GREEN Color.WHITE..

Shader for Android OpenGL ES

http://stackoverflow.com/questions/4850025/shader-for-android-opengl-es

for Android OpenGL ES Is it possible to use vertex or pixel shaders in android app please give an example if possible of.. is a code example of how to load a shader public int createProgram String vertexSource String fragmentSource int vertexShader loadShader GLES20.GL_VERTEX_SHADER vertexSource int pixelShader loadShader GLES20.GL_FRAGMENT_SHADER fragmentSource int.. of how to load a shader public int createProgram String vertexSource String fragmentSource int vertexShader loadShader GLES20.GL_VERTEX_SHADER vertexSource int pixelShader loadShader GLES20.GL_FRAGMENT_SHADER fragmentSource int program GLES20.glCreateProgram..

Enable hardware acceleration in Android app, targeting Honeycomb AND prior versions

http://stackoverflow.com/questions/5158824/enable-hardware-acceleration-in-android-app-targeting-honeycomb-and-prior-versi

operations. When the hardware accelerated renderer is enabled most operations in Canvas Paint Xfermode ColorFilter Shader and Camera are accelerated. This results in smoother animations smoother scrolling and improved responsiveness overall even..

Android: Shader behave different in 'onDraw(canvas)' and 'new Canvas(bitmap)'

http://stackoverflow.com/questions/5231260/android-shader-behave-different-in-ondrawcanvas-and-new-canvasbitmap

Shader behave different in 'onDraw canvas ' and 'new Canvas bitmap ' I am trying to create a reflection shadow and found an issue... 3 2 source.getHeight source.getWidth 3 2 source.getHeight 2 0x7FFFFFFF 0x00FFFFFF TileMode.CLAMP paint2.setShader shader paint2.setXfermode new PorterDuffXfermode android.graphics.PorterDuff.Mode.DST_IN canvas.drawRect source.getWidth.. 1 2 source.getHeight source.getWidth 1 2 source.getHeight 2 0x7FFFFFFF 0x00FFFFFF TileMode.CLAMP paint2.setShader shader paint2.setXfermode new PorterDuffXfermode android.graphics.PorterDuff.Mode.DST_IN canvas2.drawRect 0 source.getHeight..

How do the pieces of Android's (2D) Canvas drawing pipeline fit together?

http://stackoverflow.com/questions/5762727/how-do-the-pieces-of-androids-2d-canvas-drawing-pipeline-fit-together

understanding of how the components of Android's 2D Canvas drawing pipeline fit together. For example how do XferMode Shader MaskFilter and ColorFilter interact The reference docs for these classes are pretty sparse and the docs for Canvas and Paint.. layers e.g. shadows SkMaskFilter modifications to the alpha mask before it is colorized and drawn e.g. blur emboss SkShader e.g. gradients linear radial sweep bitmap patterns clamp repeat mirror SkColorFilter modify the source color s before applying.. do they always ignore the Paint 's color and use use their intrinsic color instead The source colors come from the Shader . In drawBitmap the Shader is temporarily replaced by a BitmapShader if a non ALPHA_8 Bitmap is used. In other cases if..

Gradient appears banded in a SurfaceView, but looks very smooth in a normal View

http://stackoverflow.com/questions/7774867/gradient-appears-banded-in-a-surfaceview-but-looks-very-smooth-in-a-normal-view

new Paint paint.setStyle Paint.Style.FILL paint.setAntiAlias false paint.setFilterBitmap false paint.setDither false Shader shader new LinearGradient 0 0 0 200 new int 0xff150d2f 0xff432b96 null Shader.TileMode.CLAMP paint.setShader shader canvas.drawRect.. false paint.setDither false Shader shader new LinearGradient 0 0 0 200 new int 0xff150d2f 0xff432b96 null Shader.TileMode.CLAMP paint.setShader shader canvas.drawRect 0 0 getWidth getHeight paint Here is the screenshot showing the SurfaceView.. false Shader shader new LinearGradient 0 0 0 200 new int 0xff150d2f 0xff432b96 null Shader.TileMode.CLAMP paint.setShader shader canvas.drawRect 0 0 getWidth getHeight paint Here is the screenshot showing the SurfaceView above and the normal..

ImageView with rounded corners and inner shadow

http://stackoverflow.com/questions/9469748/imageview-with-rounded-corners-and-inner-shadow

mPaint new Paint Paint.ANTI_ALIAS_FLAG mPaint.setColor 0xFF000000 canvas.drawRoundRect frame radius radius mPaint Shader bitmapShader new BitmapShader mBitmap TileMode.CLAMP TileMode.CLAMP mPaint new Paint Paint.ANTI_ALIAS_FLAG mPaint.setColor.. Paint Paint.ANTI_ALIAS_FLAG mPaint.setColor 0xFF000000 canvas.drawRoundRect frame radius radius mPaint Shader bitmapShader new BitmapShader mBitmap TileMode.CLAMP TileMode.CLAMP mPaint new Paint Paint.ANTI_ALIAS_FLAG mPaint.setColor 0xFF000000.. mPaint.setColor 0xFF000000 canvas.drawRoundRect frame radius radius mPaint Shader bitmapShader new BitmapShader mBitmap TileMode.CLAMP TileMode.CLAMP mPaint new Paint Paint.ANTI_ALIAS_FLAG mPaint.setColor 0xFF000000 mPaint.setMaskFilter..