Git Product home page Git Product logo

Comments (10)

MasDennis avatar MasDennis commented on July 20, 2024

I'll try to get a Xoom to see what's going on. Have to figure out where to get it though :-) Will keep you posted.

from rajawali.

ChristofferGreen avatar ChristofferGreen commented on July 20, 2024

One more detail on the Xoom. On startup with the sepiafilter applied there appears to be 1 frame rendered with black artifacts similar to the Wildfire (but fullscreen instead of half screen). But since it is only 1 frame the next frames are 100% black.

An alternative to you buying stuff could perhaps be for me to learn more about whats going on and fixing it myself, is there any documentation I can read that will make me understand a bit more about this kind of post process rendering?

from rajawali.

MasDennis avatar MasDennis commented on July 20, 2024

I can borrow a Xoom from one of my colleagues. He's going to bring it in tomorrow :-)

from rajawali.

ChristofferGreen avatar ChristofferGreen commented on July 20, 2024

Oh, cool :)

from rajawali.

MasDennis avatar MasDennis commented on July 20, 2024

Yes, maybe you can look at it in the meantime. Post processing basically works like this:
The whole scene is rendered into a texture. A frame buffer object (FBO) is used for this. (see src/rajawali/renderer/PostProcessingRenderer.java)
When the whole scene is rendered into this texture it will be displayed on a screen quad using your Camera2D class.

The last fix I did was setting the size of the framebuffer to the nearest power of two size. For performance reasons, I set it to the power of two size that's smaller than the current screen size. You might want to check if something is going wrong there.

Let me know if you need more info.

from rajawali.

ChristofferGreen avatar ChristofferGreen commented on July 20, 2024

Thanks :).
Looking at it a bit now, one interesting thing is that the Rajawali Example app (that I got from from google play) with the swirling monkey example works on the xoom. But when I use this.addPostProcessingFilter(new SwirlFilter(mViewportWidth, mViewportHeight, 10, 1f)); in my app (at the end of initScene) I get the previously mentioned black screen. So perhaps this might just be me doing something very wrong. Anyways, looking into it.

from rajawali.

ChristofferGreen avatar ChristofferGreen commented on July 20, 2024

A small update:

I have tried creating a very tiny example project (just a simple sphere with a texture) as a normal app and a live wallpaper and applied the sepia filter and it works just fine on the Xoom. The problem I am describing here apparently has something to do with something I am doing in the project that can be seen in the above screenshot from my wildfire so I shall need to do some more bug hunting :)

from rajawali.

ChristofferGreen avatar ChristofferGreen commented on July 20, 2024

Aha! Found a bug here!

Transparency is apparently not compatible with post processing.

public void initScene() {
    SimpleMaterial mat = new SimpleMaterial();
    Bitmap bg = BitmapFactory.decodeResource(mContext.getResources(), R.raw.clouds512);
    Sphere sphere = new Sphere(1, 12, 12);
    sphere.addTexture(mTextureManager.addTexture(bg));
    sphere.setMaterial(mat);
    addChild(sphere);
    BaseObject3D sphere2 = sphere.clone();
    sphere2.setX(1.0f);
    //sphere2.setTransparent(true); <------ evil!!!!!!!!!!!!!!!!!!!!!!
    addChild(sphere2);


    SepiaFilter sepiaFilter = new SepiaFilter();
    this.addPostProcessingFilter(sepiaFilter);

    mCamera.setZ(-4.2f);
    startRendering();
}

uncomment the sphere2.setTransparent(true); line and the Xoom shows a black screen, comment it and it shows two spheres in sepia color.

from rajawali.

MasDennis avatar MasDennis commented on July 20, 2024

Good find! I'll see if I can fix this tomorrow.

from rajawali.

ChristofferGreen avatar ChristofferGreen commented on July 20, 2024

Yay, it works now, both on my wildfire and my xoom. Thanks :)

from rajawali.

Related Issues (20)

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.