Giter VIP home page Giter VIP logo

rajawali's Introduction

AndroidLibs License Maven Central Maven Central

Build Status

Master Branch Status
CircleCI codecov

Develop Branch Status
CircleCI

News

06/23/2017 Bombshell 1.1.970 has been released. It fixes behavior of Objects of zero size, TextureView, TextureManager, Toon Shader color setters, custom shaders and more... It also adds preprocessor directive support for shader plugins, configurable skybox geometry, and extends our Unit Text Framework.

11/16/2016 Bombshell 1.1.777 has been released. It fixes a small number of bugs and adds a Scan Line post processing effect (thanks @contriteobserver).

9/7/2016 The official release of Bombshell 1.1.610 is out. We will continue to support this release moving forward how ever bug fixes will be minimal. The decision was made that the design of the core engine was inhibiting correcting some of the larger issues. To this end, we have begun development of a 2.0 version - see issue 1755 for details. Development is happening in the v2.0-development branch here

8/29/2016 An initial effort for adding unit testing to Rajawali has been made. This initial focus has been on the core math classes and will ideally expand as bug fixes progress. Pull requests for unit tests are welcome and any "bug fix" PRs which include unit tests or issues which include unit tests to demonstrate a failure will be given the highest priority.

General

Rajawali is a 3D engine for Android based on OpenGL ES 2.0/3.0. It can be used for normal apps as well as live wallpapers.

Want to keep the developers going? Buy them a beer! (http://www.pledgie.com/campaigns/21807)

Join the Rajawali Community on Rajawali Community on Google Plus to stay up-to-date on the latest news.

The RajawaliExamples project is an ever growing toolkit for developing 3D content. Check it out!

Made With Rajawali

Numerous apps and live wallpapers have been made with Rajawali. Check them out!

Using Rajawali with mavenCentral()

Using Rajawali is as simple as adding a single line to your gradle dependencies:

implementation 'org.rajawali3d:rajawali:x.x.x@aar where x.x.x is the version number (and the last number is the build number). If you wish to use the master branch snapshot, append -SNAPSHOT. For example, to use release 1.0.325, you would use:

implementation 'org.rajawali3d:rajawali:1.0.325@aar

To use the master branch build 48 snapshot 1.0.48-SNAPSHOT, you would use:

implementation 'org.rajawali3d:rajawali:1.0.48-SNAPSHOT@aar

All commits to master and development branch are deployed as snapshots. All tags will be deployed as releases. To see the latest build number, see the build history and be sure you choose a master branch build.

For the above to work you will need to make sure your repository list includes:

mavenCentral() for releases, and maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } for snapshots.

Alternatively, if you checkout Rajawali via GIT, you can run gradle assembleRelease uploadArchives (or simply add a Gralde launch config to Android Studio for the assembleRelease and uploadArchives tasks). This will deploy to your local maven repository. Consuming apps should have mavenLocal() in their repository list and add implementation 'org.rajawali3d:rajawali:1.0.0-SNAPSHOT@aar to their dependencies.

Using Rajawali with Jitpack

Just add the following lines to your build.gradle Here you see more details https://jitpack.io/#rajawali/rajawali

dependencies {
    implementation "com.github.rajawali:rajawali:$latest_version"
}

To tell Gradle where to find the library, make sure build.gradle also contains this:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Rajawali Examples On The Market

Download the free app

Rajawali + Augmented Reality

RajawaliVuforia GitHub

YouTube Video of RajawaliVuforia in action

Rajawali + Virtual Reality

RajawaliVR GitHub

YouTube Video of RajawaliVR in action

Tutorials

  1. Basic Setup & Sphere (Maven) 1. Basic Setup & a Sphere (Out of date)
  2. Creating a Live Wallpaper and Importing a Model
  3. Materials
  4. Optimization
  5. [Skybox] (https://github.com/MasDennis/Rajawali/wiki/Tutorial-05-Skybox)
  6. [Screenshots] (https://github.com/MasDennis/Rajawali/wiki/Tutorial-06-Screenshots)
  7. [Plugins] (https://github.com/MasDennis/Rajawali/wiki/Tutorial-07-Plugins)
  8. [User Interface Elements] (https://github.com/MasDennis/Rajawali/wiki/Tutorial-08-Adding-User-Interface-Elements)
  9. Creating a Custom Material GLSL Shader
  10. 2D Renderer
  11. Particles
  12. Object Picking
  13. Animation Classes
  14. Bump Normal Mapping
  15. MD2 Animation
  16. Collision Detection
  17. Importing .Obj Files
  18. Drawing Lines
  19. Catmull Rom Splines
  20. Animated Sprites
  21. Fog
  22. More Optimisation
  23. Custom Vertex Shader
  24. Using Geometry Data To Position And Rotate Objects
  25. Video Material
  26. Orthographic Camera
  27. Texture Compression
  28. Transparent Textures
  29. Skeletal Animation
  30. Creating a Day Dream
  31. [Using RajawaliScene] (https://github.com/MasDennis/Rajawali/wiki/Tutorial-31-Using-RajawaliScene)

Tutorials & Articles By Others

Learn Rajawali at a Training Center

rajawali's People

Contributors

adamantivm avatar aina-no-software avatar andrewjo avatar androidder avatar arjansomers avatar artimunor avatar chegewara avatar christoffergreen avatar contriteobserver avatar czdravko avatar davhed avatar dbarkar avatar dcerisano avatar dependabot-preview[bot] avatar dependabot[bot] avatar duiker101 avatar gormanb avatar hannesa2 avatar jaben avatar jayschwa avatar jwoolston avatar kedzie avatar lfrohman avatar masdennis avatar rpicolet avatar stscallen avatar toxicbakery avatar valentindashinsky avatar vkotovv avatar xroberx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rajawali's Issues

Live Wallpaper slow animation

I have this live wallpaper code

http://pastebin.com/xT5dKx1m

8*8 cubes on it. it take 3-5 seconds from the wake up to load all. (very slow on a galaxy s2 too)
and the other thing: after some time my phone slowed down, and the aniamtions went very laggy, I cant to use the swype/slide function to change the home screens.

Am I doing something wrong?

Touch ripple not working within lwp

When trying to add touch ripple effect within a rajawali based live wallpaper, eclipse states that "touch ripple" is not defined within wallpaper.

VertexAnimationObject3D clone not working

Trying to clone an md2,

give me an:

06-03 08:39:38.422: E/AndroidRuntime(13825): java.lang.ClassCastException: rajawali.BaseObject3D cannot be cast to rajawali.animation.mesh.VertexAnimationObject3D

but all the items are declared as: VertexAnimationObject3D

Change Texture on Model more than once

Hi.

I'm trying to switch textures on a simple cube but it only works once. I can change the Texture in my preferences.

When I first select the new texture, the model switches to that. But when I want to change to the same texture the second time, it wont switch. It only switches when I havent already selected the texture.

I'm using:

mCube.addTexture(texInfo[0]);

to set the texture to the Model. texInfo is an array with 3 loaded Bitmaps.

Danny

Memory optimisation for materials commit

The following commit (Memory optimisation for materials):

f286662

... makes the SimpleMaterial textures to not be shown.

The offending line is the removal of the reload() method in the overriden constructor.

Fix: Add reload() again.

CRASH: Arraylist issue in mTextureSlots.get(0);

I got a user stack trace from google play, so far I'm unable to reproduce though. Seems either extremely rare, or sku dependant. Here's the trace:

java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257)
at java.util.ArrayList.get(ArrayList.java:311)
at rajawali.materials.TextureManager.addTexture(TextureManager.java:102)
at rajawali.materials.TextureManager.addTexture(TextureManager.java:95)
at rajawali.materials.TextureManager.addTexture(TextureManager.java:78)
at rajawali.materials.TextureManager.addTexture(TextureManager.java:70)
at rajawali.materials.TextureManager.addTexture(TextureManager.java:66)
at com.Grotto.GrottoRenderer.GetTextureInfoDiffuse(GrottoRenderer.java:439)
at com.Grotto.GrottoRenderer.GetTextureInfoDiffuse(GrottoRenderer.java:403)
at com.Grotto.GrottoRenderer.initScene(GrottoRenderer.java:246)
at rajawali.renderer.RajawaliRenderer.onSurfaceCreated(RajawaliRenderer.java:215)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1353)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1123)

looks like rajawali.materials.TextureManager.addTexture(TextureManager.java:102) is the failing point?

My code that calls the addtexture() is:

    objTree = LoadSerializedMesh(R.raw.ser_tree);       
    treeMat = new MaterialUnlitBasic();
    objTree.setMaterial(treeMat); 
    treeMat.addTexture(GetTextureInfoDiffuse(R.drawable.tex_tree));

private TextureInfo GetTextureInfoDiffuse(int resourceID)
{
    Bitmap bitmapResource;
    bitmapResource = BitmapFactory.decodeResource(mContext.getResources(), resourceID);

    TextureInfo textureInfoResource = mTextureManager.addTexture(bitmapResource);
    return textureInfoResource;
}

Live Wallpaper slow back from sleep

It will take a time to the render on Live Wallpaper, to uploading the datas again, and rendering the all scene again, (2-3 second)

maybe because on the init reeload all textures, and other things? on the live wallpaper this doesnt required , because -I think on the live wallpapers the opengl/android dont release the texture and vertex etc datas. ?

passing modelview matrix and projection matrix values in rendering

hi,
i came up with a new curiousness that how can i render model using model view matrix and projection matrix if i have them. it will be great to draw model which look like placed in real world.
i tried few things but came up with no solution,can you help me with that.
i am following your works, thanks and keep up the efforts.

Phong and Gouraud Material not working

Hi,

I downloaded the last version of your framework and it seems that there's a problem with the Phong and Gouraud Material, even when I execute the examples' application from google play. In the material example I only see the first monkey and the last one.

In the LogCat I only see the following trace:

05-28 01:41:38.492: D/Rajawali(2119): [rajawali.materials.PhongMaterial] Could not get uniform location for uNMatrix
05-28 01:41:38.492: D/Rajawali(2119): [rajawali.materials.PhongMaterial] Could not get uniform location for uAmbientColor
05-28 01:41:38.492: D/Rajawali(2119): [rajawali.materials.PhongMaterial] Could not get uniform location for uAmbientIntensity
05-28 01:41:38.496: D/Rajawali(2119): [rajawali.materials.PhongMaterial] Could not get uniform location for uLightColor0
05-28 01:41:38.496: D/Rajawali(2119): [rajawali.materials.PhongMaterial] Could not get uniform location for uLightPower0
05-28 01:41:38.496: D/Rajawali(2119): [rajawali.materials.PhongMaterial] Could not get uniform location for uLightPosition0
05-28 01:41:38.496: D/Rajawali(2119): [rajawali.materials.PhongMaterial] Could not get uniform location for uLightDirection0
05-28 01:41:38.496: D/Rajawali(2119): [rajawali.materials.PhongMaterial] Could not get uniform location for uLightAttenuation0
05-28 01:41:38.496: D/Rajawali(2119): [rajawali.materials.PhongMaterial] Could not get uniform location for uSpecularColor
05-28 01:41:38.496: D/Rajawali(2119): [rajawali.materials.PhongMaterial] Could not get uniform location for uShininess
05-28 01:41:38.636: E/Rajawali(2119): [rajawali.materials.PhongMaterial] Could not compile fragment shader:
05-28 01:41:38.644: E/Rajawali(2119): Shader log: Compile failed.

I have a Samsung Galaxy S, if it helps...

Thank you very much.

Regards.

math package

Is it possible that you forgot to commit the import rajawali.math.Number3D; package into Rajawali?
I just forked the project and wanted to try it, but due to this error, I can't compile.

Thanks for having a look!
Markus

Error when back from Live wallpaper's settings

I just clicking settings, then I going to back to lwp's screen:

05-24 21:03:12.675: D/Blood(18174): Creating OpenGL ES 2.0 context
05-24 21:03:12.730: D/CLIPBOARD(18174): Hide Clipboard dialog at Starting input: finished by someone else... !
05-24 21:03:14.385: D/Rajawali(18174): [rajawali.materials.DiffuseMaterial] Could not get attrib location for aColor
05-24 21:03:14.385: D/Rajawali(18174): [rajawali.materials.DiffuseMaterial] Could not get uniform location for uCameraPosition
05-24 21:03:14.385: D/Rajawali(18174): [rajawali.materials.DiffuseMaterial] Could not get uniform location for uVMatrix
05-24 21:03:14.385: D/Rajawali(18174): [rajawali.materials.DiffuseMaterial] Could not get uniform location for uLightColor0
05-24 21:03:14.385: D/Rajawali(18174): [rajawali.materials.DiffuseMaterial] Could not get uniform location for uLightPosition0
05-24 21:03:14.385: D/Rajawali(18174): [rajawali.materials.DiffuseMaterial] Could not get uniform location for uLightAttenuation0
05-24 21:03:14.385: D/Rajawali(18174): Could not get attrib location for uNormalTexture, BUMP
05-24 21:03:14.395: D/Rajawali(18174): [rajawali.materials.DiffuseMaterial] Could not get attrib location for aColor
05-24 21:03:14.395: D/Rajawali(18174): [rajawali.materials.DiffuseMaterial] Could not get uniform location for uCameraPosition
05-24 21:03:14.395: D/Rajawali(18174): [rajawali.materials.DiffuseMaterial] Could not get uniform location for uVMatrix
05-24 21:03:14.395: D/Rajawali(18174): [rajawali.materials.DiffuseMaterial] Could not get uniform location for uLightColor0
05-24 21:03:14.395: D/Rajawali(18174): [rajawali.materials.DiffuseMaterial] Could not get uniform location for uLightPosition0
05-24 21:03:14.395: D/Rajawali(18174): [rajawali.materials.DiffuseMaterial] Could not get uniform location for uLightAttenuation0
05-24 21:03:14.395: D/Rajawali(18174): Could not get attrib location for uNormalTexture, BUMP
05-24 21:03:14.400: D/Rajawali(18174): [rajawali.materials.DiffuseMaterial] Could not get attrib location for aColor
05-24 21:03:14.400: D/Rajawali(18174): [rajawali.materials.DiffuseMaterial] Could not get uniform location for uCameraPosition
05-24 21:03:14.400: D/Rajawali(18174): [rajawali.materials.DiffuseMaterial] Could not get uniform location for uVMatrix
05-24 21:03:14.400: D/Rajawali(18174): [rajawali.materials.DiffuseMaterial] Could not get uniform location for uLightColor0
05-24 21:03:14.405: D/Rajawali(18174): [rajawali.materials.DiffuseMaterial] Could not get uniform location for uLightPosition0
05-24 21:03:14.405: D/Rajawali(18174): [rajawali.materials.DiffuseMaterial] Could not get uniform location for uLightAttenuation0
05-24 21:03:14.405: D/Rajawali(18174): Could not get attrib location for uNormalTexture, BUMP
05-24 21:03:14.680: W/dalvikvm(18174): threadid=11: thread exiting with uncaught exception (group=0x40c2b1f8)
05-24 21:03:14.685: E/AndroidRuntime(18174): FATAL EXCEPTION: GLThread 8311
05-24 21:03:14.685: E/AndroidRuntime(18174): java.lang.NullPointerException
05-24 21:03:14.685: E/AndroidRuntime(18174): at rajawali.Geometry3D.createBuffers(Geometry3D.java:134)
05-24 21:03:14.685: E/AndroidRuntime(18174): at rajawali.Geometry3D.reload(Geometry3D.java:167)
05-24 21:03:14.685: E/AndroidRuntime(18174): at rajawali.BaseObject3D.reload(BaseObject3D.java:356)
05-24 21:03:14.685: E/AndroidRuntime(18174): at rajawali.renderer.RajawaliRenderer.reloadChildren(RajawaliRenderer.java:249)
05-24 21:03:14.685: E/AndroidRuntime(18174): at rajawali.renderer.RajawaliRenderer.onSurfaceCreated(RajawaliRenderer.java:235)
05-24 21:03:14.685: E/AndroidRuntime(18174): at lacroix3d.blood.mywallpaper.MyWallpaperRenderer.onSurfaceCreated(MyWallpaperRenderer.java:170)
05-24 21:03:14.685: E/AndroidRuntime(18174): at net.rbgrn.opengl.GLThread.guardedRun(GLThread.java:225)
05-24 21:03:14.685: E/AndroidRuntime(18174): at net.rbgrn.opengl.GLThread.run(GLThread.java:93)
#2

other error issue on live wallpaper:

on live wallpaper picker activity:

1, click on a rajawali wallpaper (everything load ok) -> click back
2, click on a rajawali wallpaper (everything load ok) -> click back
3, click on a rajawali wallpaper (everything load ok) -> click back
4, click on a rajawali wallpaper (everything load ok) -> click back

after 4-5 times I get:

05-24 21:05:55.440: E/AndroidRuntime(18624): java.lang.OutOfMemoryError
05-24 21:05:55.440: E/AndroidRuntime(18624): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
05-24 21:05:55.440: E/AndroidRuntime(18624): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:577)
05-24 21:05:55.440: E/AndroidRuntime(18624): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:445)
05-24 21:05:55.440: E/AndroidRuntime(18624): at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:468)
05-24 21:05:55.440: E/AndroidRuntime(18624): at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:498)
05-24 21:05:55.440: E/AndroidRuntime(18624): at lacroix3d.blood.mywallpaper.MyWallpaperRenderer.initScene(MyWallpaperRenderer.java:70)
05-24 21:05:55.440: E/AndroidRuntime(18624): at rajawali.renderer.RajawaliRenderer.onSurfaceCreated(RajawaliRenderer.java:224)
05-24 21:05:55.440: E/AndroidRuntime(18624): at lacroix3d.blood.mywallpaper.MyWallpaperRenderer.onSurfaceCreated(MyWallpaperRenderer.java:170)
05-24 21:05:55.440: E/AndroidRuntime(18624): at net.rbgrn.opengl.GLThread.guardedRun(GLThread.java:225)
05-24 21:05:55.440: E/AndroidRuntime(18624): at net.rbgrn.opengl.GLThread.run(GLThread.java:93)
#3

live wallpaper viewer again:

rotate the phone 4-5 times: (the same error above)

05-24 21:08:34.375: E/AndroidRuntime(19035): FATAL EXCEPTION: GLThread 8364
05-24 21:08:34.375: E/AndroidRuntime(19035): java.lang.OutOfMemoryError
05-24 21:08:34.375: E/AndroidRuntime(19035): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
05-24 21:08:34.375: E/AndroidRuntime(19035): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:577)
05-24 21:08:34.375: E/AndroidRuntime(19035): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:445)
05-24 21:08:34.375: E/AndroidRuntime(19035): at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:468)
05-24 21:08:34.375: E/AndroidRuntime(19035): at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:498)
05-24 21:08:34.375: E/AndroidRuntime(19035): at lacroix3d.blood.mywallpaper.MyWallpaperRenderer.initScene(MyWallpaperRenderer.java:70)
05-24 21:08:34.375: E/AndroidRuntime(19035): at rajawali.renderer.RajawaliRenderer.onSurfaceCreated(RajawaliRenderer.java:224)
05-24 21:08:34.375: E/AndroidRuntime(19035): at lacroix3d.blood.mywallpaper.MyWallpaperRenderer.onSurfaceCreated(MyWallpaperRenderer.java:170)
05-24 21:08:34.375: E/AndroidRuntime(19035): at net.rbgrn.opengl.GLThread.guardedRun(GLThread.java:225)
05-24 21:08:34.375: E/AndroidRuntime(19035): at net.rbgrn.opengl.GLThread.run(GLThread.java:93)

Am I have to release the bitmaps somewhere? Because when I recycle the bitmaps at the initScene() end, I get some new errors. :)

Tutorial for multitexturing

I d like to multitxturing with a shader,

I have two bitmaps, and a shader,
in the shader:

uniform sampler2D uTexture1;
uniform sampler2D uTexture2;

1, How can bypass the twoo textures (not a simple float, and others to the shader from simple material set... codes), Can I add a setTexture1(Bitmap ...), setTexture2(Bitmap ...) or something else?
2, with: gl_FragColor = texture2D(uTexture1, vec2(vTextureCoord.x, vTextureCoord.y));
How can I add the first texture with 100% alpha and the second with 20% on it?

MD2 and Objects with Png Textures with Transparencies

Hi,

I would like to ask you a question… I have a MD2 animation with a texture in png. This png has some transparent parts and it’s UV Mapped to de model. The issue is that when the MD2 is rendered the texture is ok but the transparent parts, which are displayed in black. Is it possible to render them as transparent? I’ll need to do the same with some other objects (BaseObject3D in this case). Could you help me?

Thank you very much!

Regards.

Examples not working on Galaxy Ace +

Hi Denis,

As I told you on your blog, I didn't manage to launch the examples on my Samsung GT-S5830i (Galaxy Ace +?). There isn’t any exception thrown, but I just get a black screen after the loading.
When I get the OpenGL version of the device at runtime (using ComponentInfo and reqGlEsVersion), I get 0x00020000. However ,when I compare the result of (GL10) gl.glGetString(GL10.GL_EXTENSIONS) on this device and on my HTC (where all the examples works perfectly well), I obtain much less texture compression formats supported. Here they are:

  • GL_OES_compressed_ETC1_RGB8_texture
  • GL_OES_compressed_paletted_texture
  • GL_OES_texture_npot
  • GL_OES_depth24
  • GL_OES_vertex_half_float
  • GL_OES_EGL_image
  • GL_EXT_discard_framebuffer
  • GL_OES_rgb8_rgba8
  • GL_OES_depth32
    Do you think the reason is that the texture compression formats used by your library is not supported by my device ?
    Thank you very much for your help,

Gabriel

Black textures on wallpaper > settings > back

Updating to latest, I'm now getting black textures on everything except the very first texture that is set. There's no verbose error or warning.

On first load it's fine, and in the activity it's fine (even when rotating and causing an update).

It happens only after going into the wallpaper preview > settings > back. All textures now appear black, across multiple material types. The only exception is the very first object that has a set texture, this looks fine.

SimpleMaterial with FOG

Hello Dennis,

Can you write the SimpleMaterial Shader with those nice colors+Fog enabled code?

Thanks,
Leslie

mFPS set to float in AAnimationObject3D

in

Rajawali / src / rajawali / animation / mesh / AAnimationObject3D.java

mFPS, getFPS, setFPS -> int to float (for some extra cool slow motion effect, maybe 0.1f)

it will be cool when you play an animation and slowing down the fps rate, and then fast up again

CRASH: eglSwapBuffers failed: EGL_BAD_ALLOC

Recieved a new error through google play error notify - here's the stack trace:

Exception class
java.lang.RuntimeException
Source method
GLSurfaceView$EglHelper.throwEglException()

java.lang.RuntimeException: eglSwapBuffers failed: EGL_BAD_ALLOC
at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1077)
at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1035)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1333)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)


It looks like this is the only one reported from a group of ~500 users, so seems rare.
It also looks like it's on v1.0, which is missing at least a good month of Rajawali updates. At this point it's impossible to know exactly what timeframe though... Due to this, I'm wondering if this is starting to present a want for versioning of Rajawali? Eg, start versioning Rajawali with each checkin, or versioning to major revisions and releases; then adding this versioning in the assert logs? This would definitely help me in updating Rajawali since I can see what major user-facing changes have been made, as well as debugging when this sort of issue happens :D

RotateAnimation3D start at the wrong angle


public class TestRenderer extends RajawaliRenderer {

        private Plane mPlane;
        private Animation3D mAnimation3D;
        public TestRenderer(Context context) {
            super(context);
            setFrameRate(60);
        }
        
        protected void initScene() {
            SimpleMaterial planeMat = new SimpleMaterial();
            Bitmap texture = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.device);
            planeMat.addTexture(mTextureManager.addTexture(texture));
            float h = 8*MathUtil.tan(45 / 360.0f * MathUtil.PI);
            float w = ((float)texture.getWidth()/texture.getHeight())*h;
            mPlane = new Plane(h,w,1,1);
//          mPlane.setRotZ(-90);
            mPlane.rotateAround(new Number3D(0, 0, 1), -90, true);// to show a image right.
            mPlane.setMaterial(planeMat);
            mPlane.setColor(0x55ffffff);
            addChild(mPlane);
            
            Number3D axis = new Number3D(0, 0, 1);
            axis.normalize();
            
            mAnimation3D = new RotateAnimation3D(axis, 0, 360);//  the mPlane will rotZ 90 first, then start the animation.
            mAnimation3D.setDuration(2000);
            mAnimation3D.setTransformable3D(mPlane);
        }
        
        public void onSurfaceCreated(GL10 gl, EGLConfig config) {
            ((RajawaliExampleActivity) mContext).showLoader();
            super.onSurfaceCreated(gl, config);
            ((RajawaliExampleActivity) mContext).hideLoader();
            
            mAnimation3D.start();
        }
        
        public void onDrawFrame(GL10 glUnused) {
            super.onDrawFrame(glUnused);
        }
    }

And i want to rotate a plane around one of the plane's edge, what should i do?

glErrors

I am trying to use your framework. When using it i noticed getting a lot of glErrors.

You don't check for glErrors in your code every frame, but if you add a check in your rendering loop as such:

    public void onDrawFrame(GL10 glUnused) {
        checkError();
        super.onDrawFrame(glUnused);

    }

    public void checkError(){
    int error;
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        Log.v("eror", "glError: " + GLU.gluErrorString(error));
    }

You will notice the errors. (I tried this in your model loading example)
I unfortunately did not yet have time to pinpoint the cause of these messages, but wanted to make you aware of them.

Loading textures for model(sdcard/res) using Bitmap.

Hi,
I am in need of urgent help regarding loading of models and their textures . I need to load two kind of models in application

  1. MD2
    2 OBJ

Both the models are loading correctly , but texture is not being rendered properly.
Please if someone could elaborate the usage/methods of loading texture will be of great help.
There are two scenario which exist for me.
1-> Model and material file (in case of OBJ) are stored in sdcard and texture bitmap is there in application
2 -> Model and material file along with texture bitmaps are present on sdcard

Post Processing Black Screen

Hello

I think having post processing stuff in Rajawali is an excellent idea and it works well on my Samsung Galaxy S but not on my Motorola Xoom or my Wildfire S. The Xoom just displays a black screen when using post processing and the Wildfire displays a screen where one side has post processing with some slight artifacts and the other side of the screen is black. I have spent some time today trying to fix it but I am getting nowhere (i'm not very good with opengl rendering commands).

Here is a screenshot from the Wildfire with the default sepia filter: http://i.imgur.com/7eeQV.png
Notice the artifacts on the image. Since the Xoom is just 100% black I did not take a screenshot of it. Please let me know if I can help fix this in any way.

(I am using the latest version of Rajawali)

Plane rendering

I was trying to add a plane from Blender:
o Plane
v -0.000001 -1.000000 -1.000000
v -0.000001 -1.000000 1.000000
v 0.000001 1.000000 1.000000
v 0.000001 1.000000 -1.000000
f 1 4 3
f 1 3 2

But I couldn't draw it on screen. Then I downloaded RajawaliTutorial1 project and replaced Sphere to Plane and still I see no plane on screen. Maybe I'm doing something wrong or there is a bug in rendering?

Trying to do a .SER file, but not working

I tried this code:

    ObjParser objParser = new ObjParser(mContext.getResources(), mTextureManager, R.raw.monkey);
    objParser.parse();

mMonkey = objParser.getParsedObject(); after objParser.parse();

then

    MeshExporter exporter = new MeshExporter(mMonkey);
    exporter.export("monkey.ser", ExportType.SERIALIZED);

I get:

05-24 14:28:58.709: E/Rajawali(27024): Serializing monkey.ser to SD card was unsuccessfull.
05-24 14:28:58.709: W/System.err(27024): java.lang.NullPointerException
05-24 14:28:58.714: W/System.err(27024): at rajawali.BaseObject3D.toSerializedObject3D(BaseObject3D.java:586)
05-24 14:28:58.714: W/System.err(27024): at rajawali.util.MeshExporter.exportToSerialized(MeshExporter.java:132)
05-24 14:28:58.714: W/System.err(27024): at rajawali.util.MeshExporter.export(MeshExporter.java:33)
05-24 14:28:58.714: W/System.err(27024): at lacroix3d.win8.mywallpaper.MyWallpaperRenderer.initScene(MyWallpaperRenderer.java:56)
05-24 14:28:58.714: W/System.err(27024): at rajawali.renderer.RajawaliRenderer.onSurfaceCreated(RajawaliRenderer.java:224)
05-24 14:28:58.714: W/System.err(27024): at lacroix3d.win8.mywallpaper.MyWallpaperRenderer.onSurfaceCreated(MyWallpaperRenderer.java:91)
05-24 14:28:58.714: W/System.err(27024): at net.rbgrn.opengl.GLThread.guardedRun(GLThread.java:225)
05-24 14:28:58.714: W/System.err(27024): at net.rbgrn.opengl.GLThread.run(GLThread.java:93)

error here:

-> mGeometry.getIndices().capacity());

Getting unfamiliar error while loading .obj

Could someone kindly explain this error for me please? I am creating my models with Cinema4D and the RiptidePro obj exporter plugin. Here's the error I am getting.

Thank you to anyone that helps.

05-31 23:38:15.793: E/AndroidRuntime(13838): FATAL EXCEPTION: GLThread 25
05-31 23:38:15.793: E/AndroidRuntime(13838): java.lang.NullPointerException
05-31 23:38:15.793: E/AndroidRuntime(13838): at rajawali.materials.TextureManager.addTexture(TextureManager.java:79)
05-31 23:38:15.793: E/AndroidRuntime(13838): at rajawali.materials.TextureManager.addTexture(TextureManager.java:71)
05-31 23:38:15.793: E/AndroidRuntime(13838): at rajawali.materials.TextureManager.addTexture(TextureManager.java:67)
05-31 23:38:15.793: E/AndroidRuntime(13838): at rajawali.parser.ObjParser$MaterialLib.setMaterial(ObjParser.java:393)
05-31 23:38:15.793: E/AndroidRuntime(13838): at rajawali.parser.ObjParser.parse(ObjParser.java:252)
05-31 23:38:15.793: E/AndroidRuntime(13838): at com.pspdemocenter.graffiti3d.GraffitiOne3DView.initScene(GraffitiOne3DView.java:38)
05-31 23:38:15.793: E/AndroidRuntime(13838): at rajawali.renderer.RajawaliRenderer.onSurfaceCreated(RajawaliRenderer.java:224)
05-31 23:38:15.793: E/AndroidRuntime(13838): at com.pspdemocenter.graffiti3d.GraffitiOne3DView.onSurfaceCreated(GraffitiOne3DView.java:60)
05-31 23:38:15.793: E/AndroidRuntime(13838): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1348)
05-31 23:38:15.793: E/AndroidRuntime(13838): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
05-31 23:38:15.913: E/libEGL(13838): call to OpenGL ES API with no current context (logged once per thread)

Building rajawali.jar / Loading MD2 from sdcard

Hi,
I need to draw md2 animations and the md2 file resides on sdcard. For doing the same i need to modify the MD2Parser and AParser classes. But , if i am attaching my rajawali project with Rajawali-Examples Project as a library project . its not loading model. and none of the examplse are working. Kindly help me with this issue...

Thanks

Multiple render passes support

For my application it is required to do multiple render passes. I need to render to a texture and then use it as an input for the second pass.

I kind of solved it by creating an object, and then calling the render function manually. I was wondering if it would be a nice feature if your framework could incorperate multiple render passes.

Then when adding an root object with the addChild() function you would say to which renderpass it belongs, and to which rendertarget you would want to render (framebuffer or texture).

If you would create such functionality it would enable more advanced renderings such as ones which a pre-process, and it could also clean up your code, since for example the post-process renderer would not be required, but could just be a later rendering pass. And the picking rendering would be a rendering pass wich is done before the main render.

I assume this would be quite a bit of work to implement, but it think it would make a nice addition. What do you think?

Is it possible to change display depth to 888?

Hello

I have been trying to figure out if it is possible to change the bit depth in Rajawali.

In wallpaper.java we have:

setEGLConfigChooser(new ConfigChooser(5, 6, 5, 0, 16, 0));

Changing it to:

setEGLConfigChooser(new ConfigChooser(8, 8, 8, 0, 16, 0));

or

setEGLConfigChooser(new ConfigChooser(8, 8, 8, 0, 0, 0));

Causes a CreateWindowSurface failed exception from EglHelper.java:118

Is this possible to accomplish? I am trying to get a higher bit depth because a user has complained that his device (galaxy note) displays banding (some googling shows that it has crappy dithering support).

Load a model within a thread

new Thread(new Runnable() { 
        @Override public void run() {
            loadModel();                
    }}).start();

in initScene

when the model loaded, it is not appear in the screen, just then after the device go sleep and wake up again.

Use as a library

Can we use it as a library instead of copy paste the entire src folder?

Semi-Transparent Textures Possible?

I have a png with various alpha values, but it only gets rendered as either opaque or fully transparent. Is it possible to display these textures correctly?

I also tried myPlane.setTransparent(true) but that just seemed to cause the plane to be pushed behind all of the objects.

Thanks for all of your work.

ArrayIndexOutOfBoundsException parsing .Obj file

I can't parse and get this .obj file (http://depositfiles.com/files/sq3ldakif ) (http://depositfiles.com/files/8xrctkf0f )(mtl)

Code:
ObjParser objParser = new ObjParser(mContext.getResources(), mTextureManager, R.raw.mesh092_obj);
objParser.parse();
mObjectGroup = objParser.getParsedObject();
mObjectGroup.addLight(mLight);
addChild(mObjectGroup);

android:minSdkVersion="12"

Error:
04-24 18:10:10.575: E/AndroidRuntime(19374): java.lang.ArrayIndexOutOfBoundsException: length=88258; index=-32767
04-24 18:10:10.575: E/AndroidRuntime(19374): at java.util.ArrayList.get(ArrayList.java:306)
04-24 18:10:10.575: E/AndroidRuntime(19374): at rajawali.parser.ObjParser.parse(ObjParser.java:194)
04-24 18:10:10.575: E/AndroidRuntime(19374): at master.unict.it.RajawaliTestRender.initScene(RajawaliTestRender.java:60)

2 Bugs with new resource management? Clones dissapear, mipmapping

Hello

I have been playing with the new resource management stuff and I might have found two bugs.

  1. Textures appear to loose their mipmapping setting when the opengl context is lost and then regained (that is they stop being mippmapped).
  2. Clones of BaseObject3D disappear from view when the opengl view is lost and then regained. By disappear I mean they
    are no longer visible, I do not know if this means that they are destroyed or so.

To recreate bug #2, try creating 2 objects side by side, one being a clone of the other (via the clone() method in BaseObject3D) in a live wallpaper, then go into another app and then back again, now the clone is no longer visible. I did this from an object created with the obj importer.

Custom Material error

I just wrote a little material, that is scrolling fromright to left

package lacroix3d.materials;

import rajawali.materials.AMaterial;
import android.opengl.GLES20;

public class ScrollLeftRightMaterial extends AMaterial {
protected int muTimeHandle;

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" +
    "uniform float uTime;\n" +
    "varying vec4 vColor;\n" +

    "void main() {\n" +
    "#ifdef TEXTURED\n" +
    "   gl_FragColor = texture2D(uDiffuseTexture, vec2(vTextureCoord.x, vTextureCoord.y + uTime));\n" +
    "#else\n" +
    "   gl_FragColor = vColor;\n" +
    "#endif\n" +
    "}\n";

public ScrollLeftRightMaterial() {
    super(mVShader, mFShader, true);
    setShaders(mUntouchedVertexShader, mUntouchedFragmentShader);
}

public ScrollLeftRightMaterial(String vertexShader, String fragmentShader) {
    super(vertexShader, fragmentShader, true);
    setShaders(mUntouchedVertexShader, mUntouchedFragmentShader);
}

public void setShaders(String vertexShader, String fragmentShader)  {
    super.setShaders(vertexShader, fragmentShader);
    muTimeHandle = getUniformLocation("uTime");
}

public void setTime(float time) {
    GLES20.glUniform1f(muTimeHandle, time);
}

then:

mTime+=0.005f; planematerial.setTime(mTime);

the error: after a while the picture quality will be very bad (pixelate), why?

3d camera+2d camera together

How can I use this?

1, draw some objects in 3d world
2, setup the 2d camera (ortho)
3, draw a 2d plane on a coord, like x=20, y=50, w=100, h=100

Some shader help need

--1
Is there a way to use a dinamic sea lighting on a modell? Like ripple effect on a model? (a simple diffuse texture and an other that is a ripple texture)

--2
How can I texture transform on a model? so I have a plane, and I d like to scrolling the texture left from right infinite.
Will shader it can will do? How?

Ability to change the Blend-mode

            //GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
            GLES20.glBlendFunc(GLES20.GL_ONE, GLES20.GL_ONE_MINUS_SRC_ALPHA);

and others

How to use onTouch event to pass variable into shader

I have a customer shader that will generate a heart beat animation.
https://gist.github.com/2863517

My questions is, how can I utilise the onTouch event to pass in an additional uniform variable to change the color of the heart.

I have tried to create a setter use below lines
public void setTouch(float color) {
// TODO Auto-generated method stub
GLES20.glUniform1f(muColorHandle, color);
}

And also create a getter in the setShaders method
@OverRide
public void setShaders(String vertexShader, String fragmentShader)
{
super.setShaders(vertexShader, fragmentShader);
muTimeHandle = GLES20.glGetUniformLocation(mProgram, "uTime");
muColorHandle = GLES20.glGetUniformLocation(mProgram, "uColor");
if(muTimeHandle == -1) {
throw new RuntimeException("Could not get uniform location for uTime");
}
}

And modify the mCustomFShader string to add an additional variable
"uniform float uColor;\n" +

The problem is when I try to invoke the mouse setter from the custom render,
@OverRide
public void onTouchEvent(MotionEvent event) {
// TODO Auto-generated method stub
super.onTouchEvent(event);
mCustomMaterial.setTouch(event.getX());
}

nothing seems to happen and I receive following error message from Eclipse logcat.
06-03 23:44:06.583: E/libEGL(31527): call to OpenGL ES API with no current context (logged once per thread)

Can you please kindly review the code and suggest what is the best way to pass in additional variable into custom shader

How to use texturemap/sheet?

How to use texturemap/sheet?

I have a texture/picture 1024_512, there are 2 textures on it. (512_512)
My modells (twoo modells) contains the textcoords, but rajawali can't see it (?)
Because the all 1024*512 text go to the object. How can I use that normally?

Thanks,
Leslie

Setting Alpha on BaseObject3D

I tried using setTransparent as we as setAlpha on a Plane and alpha doesn't seem to be working. I tried changing material types, but that didn't seem to change anything.

Rotating camera to match an object

A random rotation angle is set on an object group positioned at origin. If the same rotation is applied to the camera and moved to origin, the object is expected to appear just in front of the camera. But it is not.
The Renderer part am using is below.

package com.example.quaternion;

import rajawali.BaseObject3D;
import rajawali.lights.DirectionalLight;
import rajawali.materials.DiffuseMaterial;
import rajawali.math.Number3D;
import rajawali.primitives.Cube;
import rajawali.renderer.RajawaliRenderer;
import android.content.Context;

public class QuaternionRenderer extends RajawaliRenderer {

    private DirectionalLight mLight;
    private BaseObject3D mGroup;
    private Number3D mRotation;

    public QuaternionRenderer(Context context) {
        super(context);
        setBackgroundColor(0xff005aaa);
    }

    protected void initScene() {
        mLight = new DirectionalLight(0.1f, 0.2f, -1.0f);
        mLight.setColor(1, 1, 1);
        mLight.setPosition(1, 0, -2);
        mLight.setPower(1);

        // 1. this naturally works
        mRotation = new Number3D( 0, 0, 0 );

        // 2. this does not work. why?
        mRotation = new Number3D( 10, 20, 30 );

        // 3. this is what i am interested in
        //mRotation = new Number3D(Math.random()*360, Math.random()*360, Math.random()*360);

        // the group
        mGroup = new BaseObject3D();
        Cube cube = new Cube( 2 );
        cube.setMaterial(new DiffuseMaterial());
        cube.getMaterial().setUseColor(true);
        cube.setColor(0xffff0000);
        cube.addLight(mLight);
        cube.setZ( 5 );             // moving it forward
        mGroup.addChild(cube);

        // setting a random rotation on the group
        mGroup.setRotation( mRotation );
        addChild(mGroup);

        // setting the same rotation on the camera
        mCamera.setPosition(0, 0, 0);
        mCamera.setRotation( mRotation );
    }
}

I tried few experiments with the quaternion.fromRotationMatrix but it didn't help :(. So pls. Where am I missing something.

PickingRenderer very laggy, slow

When I just clicking on the screen, it will be very laggy again, I think that is because of the selecting? maybe a robost way will be good, like a ray tracking?

Custom material error #2 - only on first object?

code:

    planematerial=new MultiTextureMaterial();
    plane=new Plane(a, 1,  1, 1, 1);
    //plane.addLight(mLight);
    plane.setMaterial(planematerial);
    plane.addTexture(mTextureManager.addTexture(mTexture4, TextureType.DIFFUSE));
    plane.addTexture(mTextureManager.addTexture(mTexture2, TextureType.BUMP));
    plane.setDoubleSided(true);
    plane.setPosition(0, -1, 0);
    addChild(plane);


    planematerial2=new MultiTextureMaterial();
    plane2=new Plane(a, 1,  1, 1, 1);
    //plane.addLight(mLight);
    plane2.setMaterial(planematerial2);
    plane2.addTexture(mTextureManager.addTexture(mTexture3, TextureType.DIFFUSE));
    plane2.addTexture(mTextureManager.addTexture(mTexture2, TextureType.BUMP));
    plane2.setDoubleSided(true);
    plane2.setPosition(0, 1, 0);
    addChild(plane2);

and my MultiTextureMaterial:

    "    vec4 src = texture2D(uDiffuseTexture, vec2(vTextureCoord.x, vTextureCoord.y));\n" +
    "    vec4 dst = texture2D(uNormalTexture, vec2(vTextureCoord.x + time, vTextureCoord.y + time))*alpha;\n" +
    "    vec4 col3 = vec4(src.a)*src + vec4(1.0)*dst;\n"+ //GL10.GL_SRC_ALPHA, GL10.GL_ONE

onDrawFrame:

public void onDrawFrame(GL10 glUnused) {
    super.onDrawFrame(glUnused);

    mTime+=0.001f; if (mTime>1) mTime-=1;   
    planematerial.setTime(mTime); 
    planematerial.setAlpha(lnpAlpha.next().value()); 

    planematerial2.setTime(mTime); 
    planematerial2.setAlpha(lnpAlpha.next().value()); 

}

so I have twoo textured planes, but the multitextureMaterial only appear on the first object, never on the second.

load a MD2 model from sdcard.

HI

I am trying to load a MD2 model from SDcard . And i update the MD2Parser.class and AParser.class and replace the JAR file into my Rajawali example project but it is not working properly. it removes the all rest of the example. please advice the proper way to load it only from SDcard without interaction of resource file.

thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.