This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void CalculateEdgeNormal(float& nx, float& ny, float x0, float y0, float x1, float y1) | |
{ | |
const float x01 = x1 - x0; | |
const float y01 = y1 - y0; | |
const float length = Sqrt(x01 * x01 + y01 * y01); | |
const float dx = x01 / length; | |
const float dy = y01 / length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Output | |
{ | |
float4 position_cs : SV_POSITION; | |
float2 texcoord : TEXCOORD; | |
}; | |
Output main(uint id: SV_VertexID) | |
{ | |
Output output; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var max_sum = -Inf, best_begin = 0, best_end = 0, cur_begin = 0, cur_sum = 0 | |
for (i = 0; i < values.length; ++i) | |
# Add the current value into our working sum | |
cur_sum += values[i] | |
# Update the max sum if we beat it | |
if cur_sum > max_sum: | |
max_sum = cur_sum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// bind gloss {label:"Gloss", default:0.5, max:1, step:0.01} | |
// bind cdiff {label:"Diffuse Colour", r:0.6, g:0.0, b:0.0} | |
// bind cspec {label:"Specular Colour", r:0.3, g:0.3, b:0.3} | |
// bind lightstrength {label:"Light Strength", default:3, max:100, step:0.1} | |
// bind envtop {label:"Environment Top", r:0.0, g:0.2, b:0.4} | |
// bind envmiddle {label:"Environment Middle", r:0.2, g:0.2, b:0.2} | |
// bind envbottom {label:"Environment Bottom", r:0.01, g:0.1, b:0.01} | |
// bind refractiveindex {label:"Refracive Index", default:1.5, max:3, step:0.1} | |
// bind normalmap {label:"Normal Map", default:false} | |
// bind diffuse {label:"Diffuse", default:true} |
NewerOlder