Comments (8)
GL_SMOOTH and GL_FLAT are 1.1 fixed pipeline functionality. You can use DiffuseMaterial or PhongMaterial instead.
Do you mean the camera's maxZ? mCamera.setFarPlane().
from rajawali.
thanks! And how to use transparency? So ALPHA_TEST, GL_GREATER > 0.1f (cut
the alpha png-s) in 2.0? this is a shader too?
thanks,
Leslie
On Wed, May 30, 2012 at 6:57 PM, Dennis Ippel <
[email protected]
wrote:
GL_SMOOTH and GL_FLAT are 1.1 fixed pipeline functionality. You can use
DiffuseMaterial or PhongMaterial instead.
Do you mean the camera's maxZ? mCamera.setFarPlane().
Reply to this email directly or view it on GitHub:
#42 (comment)
from rajawali.
my3DObject.setTransparent(true);
from rajawali.
no
i dont want to use this:
GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
i d like to use this:
gl.glEnable(GL10.GL_ALPHA_TEST);
gl.glAlphaFunc(GL11.GL_GREATER, 0.1f);
but glAlphaFunc is not exists (non fixed pipeline)
from rajawali.
I bet you do, but that's using GL10, not GLES20. Fixed pipeline functionality as well.
from rajawali.
ok the code is: (a shader) please add this to yout project if u like it (this is ignoring the alpha<0.2f values)
package rajawali.materials;
/*
* created by lacroix (lacasrac)
*/
public class AlphatestMaterial extends AMaterial {
protected static final String mVShader =
"uniform mat4 uMVPMatrix;\n" +
"attribute vec4 aPosition;\n" +
"attribute vec2 aTextureCoord;\n" +
"attribute vec4 aColor;\n" +
"varying vec2 vTextureCoord;\n" +
"varying vec4 vColor;\n" +
"void main() {\n" +
" gl_Position = uMVPMatrix * aPosition;\n" +
" vTextureCoord = aTextureCoord;\n" +
" vColor = aColor;\n" +
"}\n";
protected static final String mFShader =
"precision mediump float;\n" +
"varying vec2 vTextureCoord;\n" +
"uniform sampler2D uDiffuseTexture;\n" +
"varying vec4 vColor;\n" +
"void main() {\n" +
"#ifdef TEXTURED \n" +
" vec4 color = texture2D(uDiffuseTexture, vTextureCoord);\n" +
" if(color.a > 0.2)\n"+
" gl_FragColor = color;\n"+
" else\n"+
" discard;\n"+
"#else\n" +
" gl_FragColor = vColor;\n" +
"#endif\n" +
"}\n";
public AlphatestMaterial() {
super(mVShader, mFShader, false);
setShaders();
}
public AlphatestMaterial(String vertexShader, String fragmentShader) {
super(vertexShader, fragmentShader, false);
setShaders();
}
}
from rajawali.
Cheers man, very much appreciated.
Why not fork Rajawali, make the changes and then submit a pull request?
Will save me some work and we'll use the true power of Github :-)
from rajawali.
Hello!
I am new here, I can't use this site yet at the moment, but I will help, if you like my work.
Best regards,
Lacroix
from rajawali.
Related Issues (20)
- build issue com.github.ben-manes.versions not found HOT 3
- jcenter repository has been depracated
- Seeking Luminance based desaturation
- Seeking Lighten and Darken Blend Modes
- Seeking point texture plugin
- improving SpriteSheetMaterialPlugin efficiency HOT 1
- Seeking Flexible Sprite Sheet Animation
- Seeking runtime adjustment of AlphaMask threshold
- Please restore AnimatedSpritesFragment to example app
- Stencil Buffer is not initializing corrrectly,
- Some `ScreenQuad` materials spew error messages at frame rate
- Objects starts to render with delay when camera if far from them HOT 1
- How to translate object with touch screen?
- anyway to implement ray in the library?
- Create Sphere with phiStart, phiLength, thetaStart, thetaLength HOT 1
- LoaderFBX.java:347 ArrayIndexOutOfBoundsException
- display obj model in AR
- Examples are broken
- When will the new version be released?
- load obj file fail,NumberFormatException: For input string: "nan"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rajawali.