New! I've written a new method using textured mesh sliders instead of greyscale max blending. There is no longer a dependency on Shader Model 2.0 or shaders in general. Porting the code over to OpenGL should be a simple process. The results with this new method are effectively identical to the previous, save for the much lower system requirements.
Details of my original method:
[quote="MetalMario201]I've shown a few screenshots and provided the source to my method, but things seem to have stagnated a bit, so let's discuss.
My method works as follows:
The curve is provided as a series of short line segments, just as osu!'s existing sliders are.
To an offscreen buffer, render each of these small segments as a rectangle with circular caps at each end. The width of the rectangle and its caps is the same as the circle size: 80, 72, 64, 56, or 48 osupixels depending.
These rectangles/circles use a special texture (actually not a texture; just vertex shading) which is white at the very center and falls off linearly to black at the outside edge.
MAX blending is used to draw these! This gives us a continuous track which is white on the inside and fades to black.
When rendering this texture to the screen, a special shader is used which substitutes values of grey with values on a linear gradient with stops, as seen in this image:
Weaknesses:
My current implementation has a Shader 2.0 dependency for the gradient substitution. It also doesn't yet support OpenGL. I'm confident both of these issues can be overcome.
For slider overlaps, the track merges instead of layering itself under the existing track.[/quote]
Advantages over current method:
The slider track can be translucent.
The slider track has a gradient from inside to outside which isn't affected strangely by curvature.
The slider track can have *variable* opacity, much like GL sliders, if desired.
The slider track can have a shadow.
The slider track is silky smooth.
Here are some examples of slider tracks drawn using this method:
The source to my demo (C#, Windows Forms, XNA 3.0) may be found at: http://up.ppy.sh/files/sliderrenderingsample2.rar
Also please note that I never intended for this code to just be dropped into osu! without issue. It's to demonstrate the theory behind it and will most certainly need to be rewritten to work with the osu! framework. I deliberately left out certain optimizations, such as the size of the offscreen texture used and the optimization of the number of segments taken, because I'm confident that they already exist within osu! and rewriting them would have been pointless.
I volunteer to implement this inside osu!
Details of my original method:
[quote="MetalMario201]I've shown a few screenshots and provided the source to my method, but things seem to have stagnated a bit, so let's discuss.
My method works as follows:
The curve is provided as a series of short line segments, just as osu!'s existing sliders are.
To an offscreen buffer, render each of these small segments as a rectangle with circular caps at each end. The width of the rectangle and its caps is the same as the circle size: 80, 72, 64, 56, or 48 osupixels depending.
These rectangles/circles use a special texture (actually not a texture; just vertex shading) which is white at the very center and falls off linearly to black at the outside edge.
MAX blending is used to draw these! This gives us a continuous track which is white on the inside and fades to black.
When rendering this texture to the screen, a special shader is used which substitutes values of grey with values on a linear gradient with stops, as seen in this image:
Weaknesses:
My current implementation has a Shader 2.0 dependency for the gradient substitution. It also doesn't yet support OpenGL. I'm confident both of these issues can be overcome.
For slider overlaps, the track merges instead of layering itself under the existing track.[/quote]
Advantages over current method:
The slider track can be translucent.
The slider track has a gradient from inside to outside which isn't affected strangely by curvature.
The slider track can have *variable* opacity, much like GL sliders, if desired.
The slider track can have a shadow.
The slider track is silky smooth.
Here are some examples of slider tracks drawn using this method:
The source to my demo (C#, Windows Forms, XNA 3.0) may be found at: http://up.ppy.sh/files/sliderrenderingsample2.rar
Also please note that I never intended for this code to just be dropped into osu! without issue. It's to demonstrate the theory behind it and will most certainly need to be rewritten to work with the osu! framework. I deliberately left out certain optimizations, such as the size of the offscreen texture used and the optimization of the number of segments taken, because I'm confident that they already exist within osu! and rewriting them would have been pointless.
I volunteer to implement this inside osu!