Comments (15)
Found why this happens at
pixi3d/src/sprite/projection-sprite.ts
Line 66 in fde244f
Maybe I should just disable that behaviour?
from pixi3d.
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.
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.
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.
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.
Would it be possible for you to provide a complete reproducable example so I can debug?
from pixi3d.
Tried refactoring this sample locally with
7.2.4
and2.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.
Local web server. I will create an isolated demo and send you a zip. Thanks.
from pixi3d.
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.
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.
Strange but true! Thank you for finding this. I didn't even consider the ROUND_PIXELS
flag. I wonder why though.
from pixi3d.
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.
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.
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.
Rendering a camera (even main) to a texture would be a very cool feature BTW.
from pixi3d.
Related Issues (20)
- Sprite3D zIndex is not applied to internal ProjectionSprite zIndex HOT 3
- Error: Extension class must have an extension object HOT 4
- vec3/planes changes errors HOT 2
- Unlit mesh color is brighter than it should be HOT 9
- iOS 16.4 rendering issue HOT 3
- Compile errors when using @pixi/math-extras HOT 3
- 3d Model and ImageBasedLighting visibility issue HOT 5
- Render shadow on "invisible" plane. HOT 5
- Can't load GLTF with shape-keys animations HOT 6
- Memory not cleared when destroying models HOT 38
- Not an issue, just greetings! HOT 1
- Boilerplate from create-pixi3d-app fails with PixiJs 7.2.4 HOT 2
- render point clouds HOT 13
- Possible to trim CompositeSprite to make it only fit the rendered object? HOT 14
- Is there a use case for pixi v7? The following code will not work properly in v7 HOT 1
- Support of LODs and map level geometry culling HOT 2
- Crashes with "Unrecognized source type to auto-detect resource" when imported in NodeJS HOT 6
- Crashes with "Could not find dependency: '@pixi/<it varies>' relative to '/node_modules/pixi3d/dist/cjs/pixi5/pixi3d.js" HOT 4
- Support for PixiJS 8 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 pixi3d.