Comments (4)
Maybe try a discard in the fragment shader?
if(basecolor.a == 0.0){
discard;
}
from rajawali.
Hello Dennis,
Thank you for the response, but I don't think I was clear with my original question. I would like parts of the texture to be semi-transparent. I believe the discard you were referring to would remove those pixels completely, correct?
The png I provide for the texture has alpha values ranging from 0 to 1 with many values in between, but the way it gets rendered it looks as though the values are all either 0 or 1. Does that make sense?
Basically I want to be able to have a plane textured with an image of a cloud or and to have parts of it be semi-transparent. I know there is the fog feature I can enable, but I don't have as much control over it and it's not quite the look I am going for.
The person in this link asks the same question, but about opengl in general, if that clears things up:
http://stackoverflow.com/questions/3634444/android-opengles-alpha-textures-not-semitransparent-but-binary-transparent
Thanks for your help.
from rajawali.
Yeah, I see what you mean. The Z-buffer must be disabled when you use transparency. Basically you have to reorder the objects based on the distance to the camera. This way they should render properly. Check http://www.opengl.org/wiki/Transparency_Sorting#Depth_Sorting
from rajawali.
And how do we do that in Rajawali framework?
Thanks, Rudo.
Edit: I found the answer in Issue 100 -
mObject.setMaterial(new SimpleMaterial());
mObject.setBlendingEnabled(true);
mObject.setBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
from rajawali.
Related Issues (20)
- 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"
- Caused by: org.rajawali3d.loader.ParsingException: Couldn't find texture ingrid HOT 1
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.