View Issue Details

IDProjectCategoryView StatusLast Update
0002435NoesisGUIC++ SDKpublic2022-11-17 20:57
Reporterjsantos Assigned Tojsantos  
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Product Version3.1.5 
Target Version3.1.6Fixed in Version3.1.6 
Summary0002435: Add support for a second texture in custom Shader Brushes
DescriptionRight now only the texture corresponding to the Image associated to the brush can be samples in a custom shader.

We should extend this to, at least, support a secondary texture. Note that this texture will use the same UV coordinates than the first one.
TagsNo tags attached.
PlatformAny

Activities

jsantos

jsantos

2022-11-17 20:57

manager   ~0008164

Added a SetTexture method to BrushShader, this way, new texture dependency properties can be created in new brushes.

public static readonly DependencyProperty TextureProperty = DependencyProperty.Register(
    "Texture", typeof(ImageSource), typeof(NoiseBrush), new PropertyMetadata(null, OnTextureChanged));

private static void OnTextureChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
    if (d is NoiseBrush brush)
    {
        brush.SetTexture((ImageSource)e.NewValue, 0);
    }
}

The extra texture is passed in the t4 register:

Texture2D input: register(t4);
SamplerState inputSampler: register(s4);

half4 GetCustomPattern(in In i)
{
    return input.Sample(inputSampler, i.uv0);
}

Issue History

Date Modified Username Field Change
2022-09-29 16:29 jsantos New Issue
2022-09-29 16:30 jsantos Assigned To => jsantos
2022-09-29 16:30 jsantos Status new => assigned
2022-09-29 16:30 jsantos Target Version => 3.1.6
2022-11-07 17:13 sfernandez Target Version 3.1.6 => 3.1.7
2022-11-07 17:15 sfernandez Target Version 3.1.7 => 3.1.6
2022-11-17 20:57 jsantos Status assigned => resolved
2022-11-17 20:57 jsantos Resolution open => fixed
2022-11-17 20:57 jsantos Fixed in Version => 3.1.6
2022-11-17 20:57 jsantos Note Added: 0008164