ComfyUI  >  Nodes  >  ComfyUI_yanc >  😼> Normal Map Lighting

ComfyUI Node: 😼> Normal Map Lighting

Class Name

> Normal Map Lighting

Category
YANC/😼 Image
Author
ALatentPlace (Account age: 1499 days)
Extension
ComfyUI_yanc
Latest Updated
7/26/2024
Github Stars
0.0K

How to Install ComfyUI_yanc

Install this extension via the ComfyUI Manager by searching for  ComfyUI_yanc
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI_yanc in the search bar
After installation, click the  Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

😼> Normal Map Lighting Description

Enhances 3D model realism by simulating light interaction with normal map surface details for dynamic textures.

😼> Normal Map Lighting:

The > Normal Map Lighting node is designed to enhance the visual realism of your 3D models by simulating the interaction of light with the surface details represented in a normal map. This node takes into account various lighting parameters such as light direction, color, and intensity to compute the diffuse and specular reflections on the surface. By doing so, it provides a more dynamic and lifelike appearance to textures, making them respond to lighting changes in a realistic manner. This node is particularly useful for artists looking to add depth and detail to their textures without increasing the polygon count of their models. It leverages advanced mathematical operations to ensure that the lighting effects are both accurate and visually appealing.

😼> Normal Map Lighting Input Parameters:

diffuse_map

The diffuse_map parameter represents the base color texture of your model. It is used as the primary color information that will be affected by the lighting calculations. This parameter should be a 4D tensor with dimensions corresponding to batch size, height, width, and color channels. The diffuse map provides the foundational color data upon which lighting effects are applied.

normal_map

The normal_map parameter is a texture that encodes the surface normals of your model. These normals are used to calculate how light interacts with the surface, creating realistic shading and highlights. The normal map should be a 4D tensor with dimensions corresponding to batch size, height, width, and color channels. It is essential for simulating the fine details of the surface without adding extra geometry.

specular_map

The specular_map parameter represents the specular reflection properties of the surface. It determines how shiny or reflective the surface appears under lighting. This parameter should be a 4D tensor with dimensions corresponding to batch size, height, width, and color channels. The specular map is crucial for achieving realistic highlights and reflections.

light_yaw

The light_yaw parameter specifies the horizontal angle of the light source in degrees. It controls the direction from which the light is coming, affecting how shadows and highlights are cast on the surface. The value should be a float, typically ranging from 0 to 360 degrees.

light_pitch

The light_pitch parameter specifies the vertical angle of the light source in degrees. It controls the elevation of the light source, influencing the intensity and position of the lighting effects. The value should be a float, typically ranging from -90 to 90 degrees.

specular_power

The specular_power parameter determines the sharpness of the specular highlights. Higher values result in smaller, sharper highlights, while lower values produce broader, softer highlights. This parameter should be a float, with typical values ranging from 1 to 100.

ambient_light

The ambient_light parameter represents the overall ambient light intensity in the scene. It affects the base illumination level of the surface, ensuring that it is not completely dark even in the absence of direct light. This parameter should be a float, with typical values ranging from 0 to 1.

NormalDiffuseStrength

The NormalDiffuseStrength parameter controls the intensity of the diffuse lighting effect. Higher values increase the impact of the normal map on the diffuse lighting, making surface details more pronounced. This parameter should be a float, with typical values ranging from 0 to 1.

SpecularHighlightsStrength

The SpecularHighlightsStrength parameter controls the intensity of the specular highlights. Higher values make the highlights more prominent, enhancing the shiny appearance of the surface. This parameter should be a float, with typical values ranging from 0 to 1.

TotalGain

The TotalGain parameter is a multiplier that adjusts the overall brightness of the final output. It allows you to fine-tune the intensity of the combined lighting effects. This parameter should be a float, with typical values ranging from 0 to 1.

color

The color parameter specifies the RGB color of the light source. It affects the hue and saturation of the lighting effects on the surface. This parameter should be an integer representing the RGB color value.

mask

The mask parameter is an optional input that allows you to specify areas of the texture that should be excluded from the lighting calculations. It should be a 4D tensor with dimensions corresponding to batch size, height, width, and color channels. If not provided, a default mask will be used.

😼> Normal Map Lighting Output Parameters:

output_tensor

The output_tensor parameter is the final result of the lighting calculations. It is a 4D tensor with dimensions corresponding to batch size, height, width, and color channels. This tensor represents the texture with applied lighting effects, including diffuse and specular reflections, adjusted according to the input parameters. The output tensor can be used directly in your rendering pipeline to achieve realistic lighting on your 3D models.

😼> Normal Map Lighting Usage Tips:

  • Adjust the light_yaw and light_pitch parameters to simulate different lighting conditions and observe how the surface details respond to changes in light direction.
  • Use higher specular_power values for materials that require sharp, glossy highlights, such as metals or polished surfaces.
  • Experiment with the NormalDiffuseStrength and SpecularHighlightsStrength parameters to balance the diffuse and specular effects, achieving the desired level of detail and realism.
  • Utilize the mask parameter to exclude specific areas from lighting calculations, allowing for more control over the final appearance of the texture.

😼> Normal Map Lighting Common Errors and Solutions:

"Input tensor dimensions mismatch"

  • Explanation: This error occurs when the input tensors (diffuse_map, normal_map, specular_map) have different dimensions.
  • Solution: Ensure that all input tensors have the same dimensions for batch size, height, width, and color channels.

"Invalid light direction angles"

  • Explanation: This error occurs when the light_yaw or light_pitch parameters are outside the valid range.
  • Solution: Verify that the light_yaw is between 0 and 360 degrees and the light_pitch is between -90 and 90 degrees.

"Specular power out of range"

  • Explanation: This error occurs when the specular_power parameter is set to a value outside the typical range.
  • Solution: Adjust the specular_power parameter to a value between 1 and 100.

"Ambient light intensity out of range"

  • Explanation: This error occurs when the ambient_light parameter is set to a value outside the typical range.
  • Solution: Ensure that the ambient_light parameter is between 0 and 1.

"Color value invalid"

  • Explanation: This error occurs when the color parameter is not a valid RGB integer.
  • Solution: Provide a valid RGB integer value for the color parameter.

😼> Normal Map Lighting Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI_yanc
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.