Class GPUVideoEffectEmboss
- Namespace
- VisioForge.Core.Types.VideoEffects
- Assembly
- VisioForge.Core.dll
GPU-accelerated emboss effect that creates a raised or stamped 3D appearance by emphasizing edges with directional lighting using DirectX hardware acceleration.
public class GPUVideoEffectEmboss : GPUVideoEffect, IGPUVideoEffectEmboss, IGPUVideoEffectInheritance
Implements
Inherited Members
Remarks
Available in: VideoCaptureCore, MediaPlayerCore, VideoEditCore (Windows only)
GPU-accelerated version using DirectX. Real-time processing with hardware acceleration for efficient embossing on high-resolution video. Significantly faster than CPU-based emboss filters, making it suitable for creative effects in live video production, real-time editing preview, and 4K/8K content where CPU processing would be too slow.
The emboss effect simulates a three-dimensional raised or stamped appearance by detecting edges and applying directional lighting. It creates the illusion of depth and texture by emphasizing edges in one direction while suppressing them in the opposite direction, similar to observing a relief sculpture or embossed metal surface under angled lighting. The result typically appears as a grayscale or desaturated image with highlighted edges that appear to protrude from or recede into the surface.
The GPU implementation uses edge detection kernels combined with directional bias executed via DirectX shaders. The shader applies a convolution kernel (typically Sobel or similar) to detect edges, then applies directional weighting to simulate lighting from a specific angle. The parallel execution on GPU allows complex multi-sample convolutions per pixel without performance penalty, producing smooth, high-quality emboss effects at real-time framerates. The amount parameter controls edge detection sensitivity and enhancement strength, while width controls the sampling radius and thus the scale of detected features.
Common applications:
- Creating artistic or stylized video effects with 3D textured appearance
- Enhancing edge visibility for technical or scientific video analysis
- Producing bas-relief or carved stone aesthetic for creative projects
- Title sequences and transitions with embossed text or graphics
- Converting video to artistic renderings with sculptural quality
- Creating vintage or aged film looks with embossed edges
Technical implementation: The shader calculates image gradients (rate of intensity change) in horizontal and vertical directions using convolution kernels. These gradients are combined with directional weighting to simulate lighting from a specific angle (typically 45° from upper-left). The amount parameter scales the gradient magnitude, controlling how pronounced edges appear. The width parameter determines the sampling radius - larger widths detect broader features and produce softer embossing, while smaller widths emphasize fine details. The GPU's parallel texture sampling makes multi-pixel neighborhood analysis practical for real-time use.
Performance characteristics: GPU emboss typically processes full HD (1920x1080) at 60fps+ with moderate settings and 4K (3840x2160) at 30fps or higher on modern graphics cards. Performance scales with width parameter as larger widths require more texture samples. The effect requires minimal GPU memory beyond texture storage. Suitable for real-time creative applications, live effects, and interactive editing with instant preview.
Parameter tuning guidelines: The default values (amount=15.0, width=0.0005) provide a balanced emboss effect suitable for most content. Lower amounts (5.0-10.0) create subtle embossing with faint edge emphasis, suitable for gentle stylization. Higher amounts (20.0-30.0) create dramatic embossing with strong edge highlights, suitable for artistic or technical applications. Lower widths (0.0001-0.0003) emphasize fine details and sharp edges; higher widths (0.001-0.005) create softer embossing with broader features emphasized. Adjust based on source content resolution and desired aesthetic - high-resolution video may need larger widths to emboss appropriately-scaled features.
Constructors
GPUVideoEffectEmboss(bool, float, float, string, TimeSpan, TimeSpan)
Initializes a new instance of the VisioForge.Core.Types.VideoEffects.GPUVideoEffectEmboss class with GPU-accelerated emboss effect.
public GPUVideoEffectEmboss(bool enabled, float amount = 15, float width = 0.0005, string name = "Emboss", TimeSpan startTime = default, TimeSpan stopTime = default)Parameters
enabledbool-
trueto enable the GPU effect immediately;falseto create the effect in a disabled state. The effect can be toggled on/off at any time without GPU resource reallocation overhead. amountfloat-
The emboss strength (0.0-30.0). Default is 15.0. Higher values create more dramatic 3D relief effects. Start with 10.0-15.0 for moderate embossing; use 20.0+ for strong artistic effects.
widthfloat-
The emboss sampling width (0.0-0.005). Default is 0.0005. Controls the scale of detected features. Smaller values (0.0001-0.0003) emphasize fine details; larger values (0.001+) create softer, broader embossing.
namestring-
An optional name identifier for this effect instance. Default is "Emboss". Used to retrieve and control specific effect instances from the GPU effects collection. Multiple emboss effects are typically not stacked as the effect is self-sufficient.
startTimeTimeSpan-
The time at which the effect should start being applied. Default is zero (from beginning). Useful for applying emboss effect only to specific segments for creative transitions or artistic sequences.
stopTimeTimeSpan-
The time at which the effect should stop being applied. Default is zero (until end). Combined with
startTime, allows time-limited embossing for specific scenes or segments.
Remarks
The GPU-accelerated implementation processes embossing entirely on the GPU using DirectX compute shaders, ensuring real-time performance with minimal CPU usage. Edge detection and directional lighting calculations are executed in parallel across all pixels, with optimized texture sampling patterns for maximum efficiency.
Requires DirectX-compatible GPU with shader model 3.0 or higher. Automatically falls back to CPU processing if GPU is unavailable, though performance will be significantly reduced. For live production or real-time creative applications, verify GPU availability before enabling this effect.
The default parameters (amount=15.0, width=0.0005) are optimized for HD content (1920x1080) and provide balanced emboss quality suitable for most applications. For 4K content, consider increasing width to 0.001 or higher to emboss appropriately-scaled features. For SD content, decrease width to 0.0003 or lower for better fine detail. Adjust amount based on desired visual impact - artistic effects benefit from higher values (20-30), while subtle stylization works well with lower values (8-12).
Properties
Amount
Gets or sets the emboss strength controlling the intensity of the edge enhancement and 3D effect.
public float Amount { get; set; }Property Value
Remarks
The amount parameter controls the magnitude of edge detection and the strength of the emboss effect:
- 0.0: No emboss effect (original image, edges not enhanced)
- 1.0-5.0: Minimal emboss (very subtle edge highlighting, barely perceptible)
- 5.0-10.0: Light emboss (gentle 3D appearance, suitable for subtle artistic effects)
- 10.0-20.0: Moderate emboss (noticeable relief effect, balanced strength)
- 20.0-30.0: Heavy emboss (dramatic 3D appearance, strong edge highlights)
Higher values amplify the gradient magnitude, making edges appear more pronounced and the embossed relief more dramatic. Very high values may cause clipping (pure white/black edges) and loss of mid-tone detail. The optimal value depends on source content contrast and desired aesthetic - low-contrast footage may need higher amounts to achieve visible embossing, while high-contrast content works well with lower amounts.
Changes to this property take effect immediately in the next rendered frame, allowing real-time adjustment during preview or live production. Default value is 15.0, providing balanced emboss strength for most content.
Width
Gets or sets the emboss sampling width controlling the scale of detected features and softness of the effect.
public float Width { get; set; }Property Value
Remarks
The width parameter determines the spatial extent of edge detection sampling, affecting which features are embossed:
- 0.0: No emboss effect (zero sampling radius)
- 0.0001-0.0003: Very narrow sampling (fine details, sharp edges, high-frequency features)
- 0.0003-0.0008: Moderate sampling (balanced detail level, typical features, default range)
- 0.0008-0.002: Wide sampling (broader features, softer embossing, less fine detail)
- 0.002-0.005: Very wide sampling (only large features embossed, very soft effect)
Width controls the radius over which pixel gradients are calculated. Smaller widths sample nearby pixels only, detecting fine details and sharp edges, resulting in crisp embossing of high-frequency features. Larger widths sample farther pixels, averaging over broader areas and detecting only significant edges or large features, resulting in softer, smoother embossing with less fine detail. This is analogous to the scale of the embossing tool - a fine-tipped tool creates sharp detailed embossing; a broad tool creates softer relief.
The appropriate width depends on source resolution and content. High-resolution video (4K+) may need larger widths (0.001+) to emboss appropriately-scaled features; standard HD can use smaller values. Content with fine textures benefits from smaller widths; content with broad shapes works with larger widths. Changes to this property take effect immediately in the next rendered frame. Default value is 0.0005, suitable for HD content with balanced detail.
Methods
GetEffectType()
Gets the specific GPU effect type identifier for this emboss effect.
public GPUVideoEffectType GetEffectType()Returns
- GPUVideoEffectType
-
Returns VisioForge.Core.Types.VideoEffects.GPUVideoEffectType.Emboss to identify this as a GPU-accelerated emboss effect with 3D relief appearance.
Remarks
This method is used by the GPU video processing pipeline to route the effect to the appropriate DirectX shader processor for hardware-accelerated edge detection and directional lighting-based embossing.