Jump to content

[FIXED] HighlightLayer Blacken orthocamera meshes


JCPalmer
 Share

Recommended Posts

I have been adding a temporary HighlightLayer when some meshes are displayed.  There is also a very fast morph going on to expand mesh from origin to full size.  The HighLightLayer stays on for an additional 100 millis.  It really pops!

I did not see any reason to dispose of the HighlightLayer.  Another mesh could be instanced & display later also with that 'Entrance' type.  The use case of a permanent HighlightLayer would probably be more common anyway.

I began rebuilding a scene I had with a Dialog displayed using an ortho camera.  When the character mesh is popping, you can briefly see part of the dialog where the mesh is.  The rest of the time the area is black when the layer doesn't even have any meshes.

I switched my entrance type to another with a different animation,  and you get what I have below (still working on the eyes).  I can probably get around this by either :

  • nuking layer when done & delaying the dialog till done,
  • not using that entrance type when there is a dialog.

 but the common use case of a permanent HighLightLayer could not.  This area bordered in yellow is all black with the layer.Selection_013.jpg

Link to comment
Share on other sites

I can, but setting up ortho camera, layermasks, & viewports is not something done by hand often.  Will transcribe a simple example.

Had another thought, 3D rigs could also have problems.  They are a 1 line change to test.  Was right they look weird, but in a different way.  Probably be mid-day Eastern before I have one with ortho.

Link to comment
Share on other sites

Change the fix in a last PR to ensure I can add other features later. Basically precise the camera the highlights are attached to in the constructor: var hl1 = new BABYLON.HighlightLayer("hl1", scene, { camera: camera });

https://github.com/BabylonJS/Babylon.js/pull/1419

The changes should be allin and in the playground monday. @meteoritool The project is build each day by DK and pushed to the playground at the same time.

CU, 

Link to comment
Share on other sites

Thanks,  still the problem with VR cameras, which I also highlighted earlier.  Just for reference, A 3D camera is a camera with 2 sub-cameras.  After each sub camera renders, the parent camera produces the final output using postprocesses & sometimes also viewports.

I am not sure that you / HighlightLayer is the one that needs to do all the fixing though.  I recently made it so you can also also run early post processes along with a 3D rig.  Still problems with people who want to run very late post processes.  These rigs can sort of break things, but as soon as someone thinks to try this in VR, it will get brought up again.

Fortunately, you do not have to worry about orthographic cameras & 3D rigs at the same time.  I thought about doing something for them to play together, but since I use the Dialog extension for my GUI, I can easily just put the dialog in the scene in billboard mode.

Think it might be a good to add a setter for the camera, if it is simple.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...