Dabbling. How do I apply a filter to a billboard sprite? #144
Unanswered
tonyfirgun
asked this question in
Q&A
Replies: 2 comments 5 replies
-
Hello! You were very close. You should not add the sprite3d to the stage as it's instead rendered using the CompositeSprite. let sprite = new Sprite3D(Texture.from("assets/png-clipart-football-football.png"))
let compositeSprite = app.stage.addChild(new CompositeSprite(
app.renderer as Renderer, { objectToRender: sprite }))
compositeSprite.filters = [new filters.BlurFilter()] Adding filters directly to sprite3d without using CompositeSprite won't work unfortunately. Not sure why you would need a mesh server side if you don't intend to render it. If you do intend to render it server side you can check out @pixi/node which is a package which enabled PixiJS/Pixi3D on there server - it was was pretty difficult to get it working though (for me at least). |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Greetings! I was attempting to add a filter to a 3d billboard sprite but I ran into problems so I must be doing this completely wrong and not understanding. I would love if anyone could lead me in the right direction please!
I've also tried adding a filter directly to the 3d billboard sprite which didn't work either. for some reason, the sprite completely vanishes after applying the filter
this.sprite.filters = [new PIXIFILTERS.ColorOverlayFilter( [1, 0, 0], [0, 0, 1], 0.001 )]
also offtopic question, how would I go upon using this serverside? I'm trying to create a mesh on both client and server for authoritative purposes but I can't import PIXI because it gives error:
PIXI3D\node_modules\@pixi\core\dist\cjs\core.js:1 ReferenceError: HTMLImageElement is not defined
Beta Was this translation helpful? Give feedback.
All reactions