Changeset View
Changeset View
Standalone View
Standalone View
src/scenegraph/shaders/sdf.glsl
Show First 20 Lines • Show All 224 Lines • ▼ Show 20 Line(s) | |||||
225 | // Since 0 is a point exactly on the outline of an sdf shape, and negative | 225 | // Since 0 is a point exactly on the outline of an sdf shape, and negative | ||
226 | // values are inside the shape, this uses a very large positive constant to | 226 | // values are inside the shape, this uses a very large positive constant to | ||
227 | // indicate a value that is really far away from the actual sdf shape. | 227 | // indicate a value that is really far away from the actual sdf shape. | ||
228 | const lowp float sdf_null = 99999.0; | 228 | const lowp float sdf_null = 99999.0; | ||
229 | 229 | | |||
230 | // A constant for a default level of smoothing when rendering an sdf. | 230 | // A constant for a default level of smoothing when rendering an sdf. | ||
231 | // | 231 | // | ||
232 | // This | 232 | // This | ||
233 | const lowp float sdf_default_smoothing = 0.001; | 233 | const lowp float sdf_default_smoothing = 0.005; | ||
234 | 234 | | |||
235 | // Render an sdf shape. | 235 | // Render an sdf shape. | ||
236 | // | 236 | // | ||
237 | // This will render the sdf shape on top of whatever source color is input, | 237 | // This will render the sdf shape on top of whatever source color is input, | ||
238 | // making sure to apply smoothing if desired. | 238 | // making sure to apply smoothing if desired. | ||
239 | // | 239 | // | ||
240 | // \param sdf The sdf shape to render. | 240 | // \param sdf The sdf shape to render. | ||
241 | // \param sourceColor The source color to render on top of. | 241 | // \param sourceColor The source color to render on top of. | ||
Show All 35 Lines |