Skip to content

Outline a 3D mesh #57

Answered by jnsmalm
Unwarped asked this question in Q&A
Sep 27, 2021 · 3 comments · 2 replies
Discussion options

You must be logged in to vote

Hi!

Maybe you have Pixi3D version which doesn't have the color class. If you use the latest version you can do:

material.baseColor = new PIXI3D.Color(0,0,1)
material.baseColor.r = 1

There is a quite easy way to do the outline effect by using PostProcessingSprite (which is almost a regular PixiJS sprite). You render the objects you want to have the outline effect on to the PostProcessingSprite and then add whatever filters you want. Here is an full example (I just changed the mesh-interact example in the repo a bit).

let app = new PIXI.Application({
  backgroundColor: 0xdddddd, resizeTo: window, antialias: true
})
document.body.appendChild(app.view)

PIXI3D.LightingEnvironment.main.lights.p…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Unwarped
Comment options

You must be logged in to vote
2 replies
@jnsmalm
Comment options

@Unwarped
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants