GithubHelp home page GithubHelp logo

Comments (15)

jnsmalm avatar jnsmalm commented on June 2, 2024 1

Found why this happens at

this.vertexData[i] = Math.round((this.vertexData[i] * resolution | 0) / resolution)

Maybe I should just disable that behaviour?

from pixi3d.

jnsmalm avatar jnsmalm commented on June 2, 2024 1

There is already a way to render to a texture, check https://api.pixi3d.org/classes/CompositeSprite.html and https://codesandbox.io/s/github/jnsmalm/pixi3d-sandbox/tree/master/post-processing-sprite

from pixi3d.

jnsmalm avatar jnsmalm commented on June 2, 2024

Are those smaller sprites not just behind the larger ones?

This works for me (just a 32x32 size sprite):

let sprite = app.stage.addChild(new PIXI3D.Sprite3D(PIXI.Texture.WHITE))

from pixi3d.

CopyCat85 avatar CopyCat85 commented on June 2, 2024

Unfortunately not behind others either - I'm trying one at a time as well. The PIXI.Texture.WHITE (16x16) doesn't render on my PIXI3D.Container3D either. These sub 200x200 textures render fine on a normal 2D PIXI.Container. Thanks for the suggestion though, but I'm utterly stumped at the moment. This isn't a loader/browser issue - it feeeeeels like a PIXI3D.Container3D on PixiJS 7.2.4 issue.

from pixi3d.

CopyCat85 avatar CopyCat85 commented on June 2, 2024

Tried refactoring this sample locally with 7.2.4 and 2.3.1 but bunny textures are not showing for me. Wondering if anyone else can validate my possible madness?

from pixi3d.

jnsmalm avatar jnsmalm commented on June 2, 2024

Would it be possible for you to provide a complete reproducable example so I can debug?

from pixi3d.

jnsmalm avatar jnsmalm commented on June 2, 2024

Tried refactoring this sample locally with 7.2.4 and 2.3.1 but bunny textures are not showing for me. Wondering if anyone else can validate my possible madness?

Are you running a local web server or are you just opening the html file in browser?

from pixi3d.

CopyCat85 avatar CopyCat85 commented on June 2, 2024

Local web server. I will create an isolated demo and send you a zip. Thanks.

from pixi3d.

CopyCat85 avatar CopyCat85 commented on June 2, 2024

Made a little demo. Needs a local web server... Hope this uploads! Thanks for looking!
pixi3dtest-01.zip

We attempt to draw 2 textures with PIXI.JS - works fine.
Next we try and draw the same two textures with PIXI3D - only the large one renders.

There should be 4 images on screen. I only see 3. If anyone see's all 4 textures, either me or my computer needs replacing.

from pixi3d.

jnsmalm avatar jnsmalm commented on June 2, 2024

Seems it doesn't works so well with this:

PIXI.settings.ROUND_PIXELS = true; // Not sure if this does anything!

Remove that and it works, this setting isn't usable in 3D space anyways.

from pixi3d.

CopyCat85 avatar CopyCat85 commented on June 2, 2024

Strange but true! Thank you for finding this. I didn't even consider the ROUND_PIXELS flag. I wonder why though.

from pixi3d.

CopyCat85 avatar CopyCat85 commented on June 2, 2024

I'm not seeing how your round-ing here can be causing small textures to not render. Personally I'm not understanding the | 0 bit myself. Also:

  • The general use case for PIXI's ROUND_PIXELS is good esp. for crisp text.
  • I do see a use case where you might want blocky 3D: low-res pixel art style 3D games.

from pixi3d.

CopyCat85 avatar CopyCat85 commented on June 2, 2024

I think we're seeing a rounding issue when we have small fractional ranges of vert values. So my bunny texture's (16x16) input verts to this function are in the range of -0.07999999821186066 to 0.07999999821186066 - and your current expression will always give zero (0.0) - which is not what we want in one sense, but it is what round() does - and would explain why the texture is not visible. I'm wondering if the issue might be elsewhere in the calculation of the verts for small textures - or do we need to swap round() with something that preserves some of the significant digits somehow? (Just a thought.)

from pixi3d.

CopyCat85 avatar CopyCat85 commented on June 2, 2024

Another thought... As you initially mentioned, in a 3D context, ROUND_PIXELS is not relevant. In the use case where you do want no interpolation in a 3D view, then really we should be rendering to a PIXI texture anyway. So, yes, I vote disable that behavior.

from pixi3d.

CopyCat85 avatar CopyCat85 commented on June 2, 2024

Rendering a camera (even main) to a texture would be a very cool feature BTW.

from pixi3d.

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.