You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was originally is the comments of the issue requesting transparent fade. I've created a new issue so the highlighting request can be tracked separately.
It would be nice to get real highlighting (outline silhouette of parts added by the current step) similar to what LEGO does; not just changing the color of edge lines of the added parts.
Fade and highlighting should be useable together.
I think I've figured out 2 different ways to do this with OpenGL at the conceptual level.
Disclaimer: This a all conceptual; I have only read OpenGL tutorials.
Method:
-- Any desired outline thickness
--- Expressed in pixel distance
--- Computational requirements increase with thickness
-- May be used to create overlays
-- Amenable to special effect
--- Color and/or transparency based on (pixel) distance from current parts
-- Most of the work happens in screen space
Method 2:
-- Outline thickness limited by part geometry constraints
-- Most of the work happens in the rasterizer
--- Uses back face culling
--- Requires that all triangles and quads of all pieces and primitives are oriented correctly
-- Should produce the same type of outline silhouettes as used in the official NASA Apollo 11 Lunar Lander - 10266 from LEGO.
--- NA edition: BI 3104, 144+4/65+200G, 10266 V39
--- Closely examine the steps to build the lander base.
---- There are artifacts
Both methods require a screen space current step parts bit mask sized to differentiate which pixels represent current step parts from background and prior step parts. I believe that this can be created using the rasterizer by rendering the prior steps parts to the depth buffer followed by rendering the current step parts to the bit mask.
Method 1:
1. Create a square kernel bit mask for the detection of nearby pixels representing current step parts.
- The size should be (2t+1) x (2t+1), where t is the thickness.
- 1's in the kernel mask are the detection points relative to the center of the kernel.
-- The default kernel mask should be circular and centered.
2. Using the current step parts bit mask (parts mask) and the kernel mask:
for (y=0; y<screensize.y; y++) {
for (x=0; x<screensize.x; x++) {
if (CURR_PART != parts_mask[x][y]) {
for (ky=-t; ky<=t; ky++) {
if (0 <= y+ky < screensize.y) {
for (kx=-t; kx<=t; kx++) {
if (CHECK == kernel[kx+t][ky+t]) {
if (0 <= x+kx < screensize.x) {
if (CURR_PART == parts_mask[x+kx][y+ky]) {
Highlight(x, y);
}
}
}
}
}
}
}
}
}
Method 2:
1. For each triangle and quad in each piece or primitive in the current step:
-- Add a highlight version of the triangle or quad to the list of triangles and quads for the current step.
--- With their face orientations reversed
--- Color is the highlight color
--- All sides extended out perpendicularly by the highlight size
---- More than 2 LDU is likely to create undesirable artifacts
2. Render the parts from the prior steps to the image and depth buffers as normal
3. Render the parts from the current step to the image and depth buffer as normal without the highlight surfaces
4. Render the highlight surfaces from the current step to the image buffer using the depth buffer and the parts mask as a stencil
The text was updated successfully, but these errors were encountered:
rsbx
changed the title
Enhancement: outline silhouettes highlighting of added parts
FEATURE REQUEST: outline silhouettes highlighting of added parts
Sep 1, 2020
This is a clarification to Method 2, "fringing", to make the masking/stenciling clearer. Replace everything after step 2 with the following:
Render the (un-"fringed") parts from the current step without updating the pixel or depth buffers but instead updating the stencil buffer to reflect which pixels would be set by the parts from the current step. This creates the mask of the pixels of the parts from the current step.
Render the "fringed" parts from the current step updating the pixel and depth buffers except for the pixels that would be set by the un-"fringed" parts from the current step i.e use the stencil buffer as a mask. This is where the silhouette is actually rendered.
Render the un-"fringed" parts from the current step updating the pixel and depth buffers. Actually render the parts from the current step.
This was originally is the comments of the issue requesting transparent fade. I've created a new issue so the highlighting request can be tracked separately.
It would be nice to get real highlighting (outline silhouette of parts added by the current step) similar to what LEGO does; not just changing the color of edge lines of the added parts.
Fade and highlighting should be useable together.
I think I've figured out 2 different ways to do this with OpenGL at the conceptual level.
Disclaimer: This a all conceptual; I have only read OpenGL tutorials.
Method:
-- Any desired outline thickness
--- Expressed in pixel distance
--- Computational requirements increase with thickness
-- May be used to create overlays
-- Amenable to special effect
--- Color and/or transparency based on (pixel) distance from current parts
-- Most of the work happens in screen space
Method 2:
-- Outline thickness limited by part geometry constraints
-- Most of the work happens in the rasterizer
--- Uses back face culling
--- Requires that all triangles and quads of all pieces and primitives are oriented correctly
-- Should produce the same type of outline silhouettes as used in the official NASA Apollo 11 Lunar Lander - 10266 from LEGO.
--- NA edition: BI 3104, 144+4/65+200G, 10266 V39
--- Closely examine the steps to build the lander base.
---- There are artifacts
Both methods require a screen space current step parts bit mask sized to differentiate which pixels represent current step parts from background and prior step parts. I believe that this can be created using the rasterizer by rendering the prior steps parts to the depth buffer followed by rendering the current step parts to the bit mask.
Method 1:
1. Create a square kernel bit mask for the detection of nearby pixels representing current step parts.
- The size should be (2t+1) x (2t+1), where t is the thickness.
- 1's in the kernel mask are the detection points relative to the center of the kernel.
-- The default kernel mask should be circular and centered.
2. Using the current step parts bit mask (parts mask) and the kernel mask:
Method 2:
1. For each triangle and quad in each piece or primitive in the current step:
-- Add a highlight version of the triangle or quad to the list of triangles and quads for the current step.
--- With their face orientations reversed
--- Color is the highlight color
--- All sides extended out perpendicularly by the highlight size
---- More than 2 LDU is likely to create undesirable artifacts
2. Render the parts from the prior steps to the image and depth buffers as normal
3. Render the parts from the current step to the image and depth buffer as normal without the highlight surfaces
4. Render the highlight surfaces from the current step to the image buffer using the depth buffer and the parts mask as a stencil
Originally posted by @rsbx in #458 (comment)
The text was updated successfully, but these errors were encountered: