WIP - Brush shading Language
![Post Post](./styles/prosilver_se/imageset/icon_post_target.gif)
![hi :hi:](./images/smilies/icon_hi.gif)
We’re starting to get some very promising results for the upcoming version of Black Ink (even if there is still a lot of work left before the release ).
We will introduce a new custom shading language: the BSL (Brush Shading Language).
It is used control how pixel are blitted on the canvas. It’s mainly a superset of HLSL which introduce a lot of helpers and simplification.
Currently, Black Ink’s brushes only output one color per primitive and the Controllers only change the size, rotation etc.. but doesn’t change how the color is applied on the whole primitive. BSL will change that and open a whole new world of (infinite?) possibilities.
Long story short, it will be possible to program smudge blurs, smoothed primitives, texture masking, noises, color aberration, water effects, and much more…
This should be really interesting for technical oriented users (like people in the Shadertoy community for example). Pure artists don’t need to worry, all that complexity will be hidden and you will be able to use custom made effects without having to know how it’s done.
The next release will only include a text based BSL editor because a nodal tool will take a lot longer to develop. This is much more complex than the Controller system.
A lot of Black Ink’s code was rewritten to support this new feature so sorry for the time this release is taking but it is going to be well worth it.
Now enough with the technical talk! This thread will show some results and advancement in our quest for more flexible and enjoyable Brush making
![wink ;)](./images/smilies/icon_wink.png)
Smooth Primitive effect
![Image](https://trello-attachments.s3.amazonaws.com/51152f49a9b654c4740160b1/613x651/e021f3ba9292bb72558a5a043bc77d1a/upload_2_5_2016_at_1_54_58_PM.png)
![Image](https://trello-attachments.s3.amazonaws.com/51152f49a9b654c4740160b1/1125x403/8efec12f50f3fbbda88b011ef8b214b1/upload_2_5_2016_at_1_55_15_PM.png)
BSL source code
$this->bbcode_second_pass_code('', 'float4 main( idatas i )
{
float sm = vmin( i.primBox.getSize() ) ;
float d = -i.primDistance ;
float softness = 0.5 ;
d /= sm*softness + 0.001 ;
float att = 1 - exp( -d );
return float4( i.color.xyz, i.color.a*att ) ;
}')
primitive space display
![Image](https://trello-attachments.s3.amazonaws.com/51152f49a9b654c4740160b1/498x279/e377ffbc70c15d4971b4911855b84f77/upload_2_5_2016_at_1_54_45_PM.png)
BSL source code
$this->bbcode_second_pass_code('', 'float4 main( idatas i )
{
matrix2 t = i.primBox.getToUpperLeftTransfo() ;
float2 p = t.transform( i.pos );
p /= i.primBox.getSize();
return float4( p.x, p.y, 0, i.color.a ) ;
}
')
distance to primtive effect
![Image](https://trello-attachments.s3.amazonaws.com/51152f49a9b654c4740160b1/400x573/fee8b0922b97dcd2c1e9aed66e396794/upload_2_5_2016_at_1_59_22_PM.png)
![Image](https://trello-attachments.s3.amazonaws.com/51152f49a9b654c4740160b1/461x624/ab3782118b6c3d04219a7b7663f14ac1/upload_2_5_2016_at_1_57_51_PM.png)
$this->bbcode_second_pass_code('', 'float4 main( idatas i )
{
float d = toDrawSpace( i.primDistance ) ;
float l = abs( cos( d*0.12 ) ) > 0.85 ? 1 : 0 ;
float3 col = lerp( float3(0.2,0.2,0.7), float3(0.7,0.5,0.2), l );
return float4( col, 1 );
}
')