3D boxes into 3D sprites? Its almost works

0 favourites
  • 7 posts
From the Asset Store
3D Car Pack 1
$2.99 USD
3D models + Rendered Low-Poly Cars in isometric, top-down, and side angles.
  • I use 3d boxes to make oldschool '3d' trees but transparency covers themselfs and i receive this effect. Maybe its possible to add new feature fot 3d shape or make 3d sprite?

  • Lol. You should try the mesh z distort. It would definitely make a better conifer.

  • Transparency doesn't work well with depth buffers which are required for 3D rendering. This is a known limitation and is probably going to stay.

  • Ashley, I know this is not a perfect solution, but I found this worked for 3DObject, when applied to each 3DQuad separately (e.g. not after a possible pre-draw, SetDepth() not enabled.)

    This is my Alpha Discard effect, pretty simple, if alpha is below the threshold, discard pixel (so it won't be written to the frame buffer or depth buffer.) It has potential perf implications, so I imagine it would be good to only use it when needed. Since I need to happen before predraw, I added in a separate color and opacity to use if needed.

    uniform lowp float threshold;
    uniform lowp vec3 colorValue;
    uniform lowp float opacity;
    
    /////////////////////////////////////////////////////////
    // AlphaDiscard
    
    //The current foreground texture co-ordinate
    varying mediump vec2 vTex;
    //The foreground texture sampler, to be sampled at vTex
    uniform lowp sampler2D samplerFront;
    
    
    void main(void)
    {
     lowp vec4 frontSample = texture2D(samplerFront, vTex);
     if (frontSample.a < threshold) {
    		discard;
    	} else {
    		gl_FragColor = vec4(colorValue*frontSample.rgb, frontSample.a)*opacity;
    	}
    }
  • I already prototyped something similar but it's blocked on a bug in Safari that causes it to break all rendering.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Transparency doesn't work well with depth buffers which are required for 3D rendering. This is a known limitation and is probably going to stay.

    Hoh that is a heart braking to hear, almost all the excitement for the New 3D features are gone for me because of that transparency issue as it looks too bad and unprofessional if you release Games in your name with that issue. I really hope you can find a fix because otherways will be no point in using it unless you use boxes etc ((:

    I was really looking forward in using the new 3D in the future.

    Quote: "This is a known limitation"

    I have never seen any other HTML Game that runs 3D with that issue perhaps they do some tricks or something but probably you tested everything already.

  • I already prototyped something similar but it's blocked on a bug in Safari that causes it to break all rendering.

    Hope there is a solution to this problem in the future, fingers crossed Ashley

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)