Houdini Algorithmic Live #095 - Pixel Art Generator

Junichiro Horikawa2 minutes read

The live stream focuses on converting 3D geometry to 2D pixel art without shaders using SOPs and COPs in Houdini. Various settings and techniques are explored, such as creating a lighting system, color mapping, adding borders, and creating shadows for a more realistic appearance.

Insights

  • The tutorial focuses on using SOPs and COPs in Houdini to convert 3D geometry into 2D pixel art without relying on shaders, offering a unique approach to creating pixelized images by representing each colored face of the grid with a dot.
  • The process involves detailed steps such as creating a lighting system, utilizing vertex-based shading, importing external color palettes, and projecting 3D images onto a 2D plane to achieve the desired pixel art effect, showcasing the intricate techniques employed to transform 3D models into pixelized 2D images.

Get key ideas from YouTube videos. It’s free

Recent questions

  • How can 3D geometry be converted into 2D pixel art?

    The process involves using SOPs and COPs in Houdini to generate 2D pixels on a plane, with each dot representing a colored face of the grid. The initial 3D geometry is pixelized to create the pixel art image, without utilizing lighting systems or shaders typically used for rendering engines. By adjusting settings like border thickness, smoothness, and resolution of pixels, users can customize the pixel art. This system offers a surface-level approach to shader-like effects, guiding users through creating basic lighting systems, vertex-based shading, and importing textures for color mapping in Houdini.

  • What is vertex-based shading in Houdini?

    Vertex-based shading in Houdini involves coloring each vertex with specific colors picked from the material, allowing for precise control over the coloring of objects. External color palettes can be imported for coloring objects, with options to adjust brightness, darkness, and lightness. By using zero to one for brightness control and creating curve mapping between fit one one and fit zero one, users can experiment with different brightness levels for varied effects. This shading technique offers a unique way to color objects in Houdini without relying on traditional lighting systems.

  • How can a 3D image be projected onto a 2D plane in Houdini?

    To project a 3D image onto a 2D plane in Houdini, users can access camera information like position, rotation, resolution, aspect ratio, focal length, aperture, near, and far clipping. By creating a perspective matrix using this camera information for perspective distortion, point positions can be converted into normalized device coordinates (NDC) using a 2nd dc function. By multiplying the inverse perspective matrix with NDC positions, the image can be projected onto a 2D plane, adjusting for aspect ratio. This process allows for the creation of a 2D image from a 3D perspective, retaining depth information for a realistic appearance.

  • How can color mapping be simplified in Houdini using VEX?

    In Houdini, color mapping can be simplified using VEX by converting color information into point positions to find the closest color value using the new point function. By mapping the closest color point to replace the current color, users can successfully map colors to a palette. This process streamlines the task of mapping colors in Houdini, offering a more efficient way to work with color information in 3D images and pixel art projects.

  • How can shadows be created in Houdini for 2D pixel art?

    Shadows in Houdini for 2D pixel art can be created by utilizing a directional light to cast shadows on a floor shape, like a grid, colored with a single random color. By intersecting rays from the camera position with obstacles, users can adjust for proper shadow creation, enhancing the shadow appearance by smoothing borders and adjusting thickness for a realistic look. Experimenting with different geometries and transferring color information to vertices can further enhance the shadow creation process, adding depth and realism to the pixel art image.

Related videos

Summary

00:00

Creating Pixel Art in Houdini Without Shaders

  • The live stream starts at 11 p.m. Japan time, marking the 95th episode of the Houdini algorithmic life series.
  • The focus is on creating a system in Houdini to convert 3D geometry into 2D pixel art without using shaders.
  • The process involves using SOPs and COPs to generate 2D pixels on a plane, with each dot representing a colored face of the grid.
  • The initial 3D geometry is pixelized to create the pixel art image.
  • Lighting systems in Houdini are not utilized, as shaders are typically used for rendering engines.
  • Vertex-based shading is employed to color each vertex with specific colors picked from the material.
  • External color palettes can be imported for coloring objects, with options to adjust brightness, darkness, and lightness.
  • Various settings like border thickness, smoothness, and resolution of pixels can be modified to customize the pixel art.
  • The system aims to convert 3D images into pixelized 2D images using SOPs, offering a surface-level approach to shader-like effects.
  • The tutorial guides users through creating a basic lighting system, vertex-based shading, and importing textures for color mapping in Houdini.

29:19

"Advanced Lighting Effects and Camera Projection Techniques"

  • Use zero to one for brightness control, creating curve mapping between fit one one and fit zero one.
  • Adjust brightness using ch ramp to control brightness or darkness levels non-linearly.
  • Experiment with different brightness levels for varied effects.
  • Create pseudo lighting systems without default shading systems.
  • Map the image into 2D pixels to observe results before adding additional features like borders or fresnel.
  • Project a 3D image from a specific camera to a 2D image using a projection matrix.
  • Access camera information like position, rotation, resolution, aspect ratio, focal length, aperture, near, and far clipping.
  • Create a perspective matrix using camera information for perspective distortion.
  • Convert point positions into normalized device coordinates (NDC) using a 2nd dc function.
  • Inverse the perspective matrix and multiply it with NDC positions to project the image onto a 2D plane, adjusting for aspect ratio.

01:01:14

"Transforming 3D Image to 2D Plane"

  • Project the image onto a plane to correct its appearance
  • Multiply the created image and replace the position to flatten it on the x-y plane
  • Setting the z value to zero places the image on the x-y plane, creating a 2D image
  • To focus on the front side of the image, adjust the z value to retain depth information
  • Calculate the depth value by measuring the distance from the camera to each vertex
  • Use intersection functions to retrieve color information from the front side of the image
  • Instead of intersection, opt for faster functions like near points or xyz distance
  • Adjust the z value to zero for easier use of near points or xyz distance functions
  • Create a grid covering the image and control the number of pixels for resolution
  • Use near points to get the nearest points on the 2D plane and visualize the front side colors

01:31:46

Mapping Color Palettes in Houdini

  • The color palette was exported from a photo editing application containing pixel information for use in Houdini.
  • To import the image, the cop cop 2 tool was utilized, adjusting the channel to one and importing the color pattern information.
  • The image from the cop displayed as points, with point information available in the attributes.
  • The goal was to search for the closest color value from the color palette and replace the color on each point.
  • A question arose about describing a plane in VEX, suggesting converting angles into quaternions for rotational information.
  • The process of mapping colors was explored in VEX, aiming to simplify the task.
  • The color information was converted into point positions to find the closest color value using the new point function.
  • The closest color point was then used to replace the current color, successfully mapping the color to the palette.
  • The ability to switch between 13 color palettes was tested, altering the appearance of the image.
  • To enhance the pixel image, a border or silhouette outline was desired, leading to the creation of an outline geometry in 3D for projection into 2D.

02:06:30

"Smoothing Borders in Geometry with Bellini"

  • The text discusses the use of a software called Bellini for a specific task involving smoothing out borders in geometry.
  • The author searches for information on "dice," unsure if it's software or something else.
  • To smooth out the border, the author plans to focus on the outer side of the geometry, merging edges with the background.
  • Information on pixels is crucial, determining if they are next to empty pixels or other geometry.
  • The author categorizes geometry into front and back groups, essential for further processing.
  • Connectivity nodes are used to identify if faces are connected to specific classes, aiding in the process.
  • The author filters pixels based on whether they are empty or part of a different geometry.
  • Post-processing involves a primitive wrangle to smooth out border pixels based on neighboring colors.
  • The author encounters challenges with poly neighbors but resolves them by using fuse for the grid.
  • A fake backlight effect is introduced using Fresnel calculations to add light to the geometry's edges, enhancing the image's appearance.

02:45:04

Creating Realistic Shadows in Game Engines

  • To create a shadow, a face is needed to cast the shadow on, specifying the geometry for shadow casting, similar to game engines.
  • Utilize a directional light to create the shadow and create a floor shape, like a grid, to cast the shadow on, colored with a single random color.
  • Merge the floor with the original geometry, ensuring proper connectivity and normal attributes.
  • Limit the directional light shading to specific points on the floor geometry to avoid overly bright areas.
  • Create shadows by intersecting rays from the camera position with obstacles, adjusting for proper shadow creation.
  • Adjust the grid resolution for more realistic shadows, ensuring high vertex count for detailed shading.
  • Enhance the shadow appearance by smoothing borders and adjusting thickness, ensuring a realistic look.
  • Experiment with different geometries like a pig head, transferring color information to vertices for shadow creation.
Channel avatarChannel avatarChannel avatarChannel avatarChannel avatar

Try it yourself — It’s free.