<commit_before>﻿module BlinnShaderProgram
open OpenTK.Graphics.OpenGL
open shader

let vertexShaderSource = System.IO.File.ReadAllText("cdlod.vs")
let fragmentShaderSource = System.IO.File.ReadAllText("Blinn.fs")

let rawShaders = [ 
    (ShaderType.VertexShader, vertexShaderSource); 
    (ShaderType.FragmentShader, fragmentShaderSource) ]

type BlinnPhongProgram = {
        ProgramId : int
        ProjectionMatrixUniform : MatrixUniform
        ViewMatrix : MatrixUniform
        ModelMatrix : MatrixUniform
        NormalMatrix : Matrix3Uniform
        AmbientColor : Vector3Uniform
        DiffuseColor : Vector3Uniform
        SpecularColor : Vector3Uniform
        MorphK : FloatUniform
    }

let makeBlinnShaderProgram =
    match makeProgram rawShaders with
    | Result.Success programId -> 
        { 
            ProgramId = programId; 
            ProjectionMatrixUniform = makeMatrixUniform programId "projectionMatrix"
            ViewMatrix = makeMatrixUniform programId "viewMatrix"
            ModelMatrix = makeMatrixUniform programId "modelMatrix"
            NormalMatrix = makeMatrix3Uniform programId "normalMatrix"
            AmbientColor = makeVector3Uniform programId "ambientColor"
            DiffuseColor = makeVector3Uniform programId "diffuseColor"
            SpecularColor = makeVector3Uniform programId "specColor"
            MorphK = makeFloatUniform programId "morphK"
        }
    | Result.Failure m -> failwith ("Program compilation failed " + m)
<commit_msg>Added morph start and morph end<commit_after>﻿module BlinnShaderProgram
open OpenTK.Graphics.OpenGL
open shader

let vertexShaderSource = System.IO.File.ReadAllText("cdlod.vs")
let fragmentShaderSource = System.IO.File.ReadAllText("Blinn.fs")

let rawShaders = [ 
    (ShaderType.VertexShader, vertexShaderSource); 
    (ShaderType.FragmentShader, fragmentShaderSource) ]

type BlinnPhongProgram = {
        ProgramId : int
        ProjectionMatrixUniform : MatrixUniform
        ViewMatrix : MatrixUniform
        ModelMatrix : MatrixUniform
        NormalMatrix : Matrix3Uniform
        AmbientColor : Vector3Uniform
        DiffuseColor : Vector3Uniform
        SpecularColor : Vector3Uniform
        MorphStart : FloatUniform
        MorphEnd : FloatUniform
    }

let makeBlinnShaderProgram =
    match makeProgram rawShaders with
    | Result.Success programId -> 
        { 
            ProgramId = programId; 
            ProjectionMatrixUniform = makeMatrixUniform programId "projectionMatrix"
            ViewMatrix = makeMatrixUniform programId "viewMatrix"
            ModelMatrix = makeMatrixUniform programId "modelMatrix"
            NormalMatrix = makeMatrix3Uniform programId "normalMatrix"
            AmbientColor = makeVector3Uniform programId "ambientColor"
            DiffuseColor = makeVector3Uniform programId "diffuseColor"
            SpecularColor = makeVector3Uniform programId "specColor"
            MorphStart = makeFloatUniform programId "morphStart"
            MorphEnd = makeFloatUniform programId "morphEnd"
        }
    | Result.Failure m -> failwith ("Program compilation failed " + m)

{'fraction_non_alphanumeric': 0.05880472994566954, 'fraction_numerical': 0.005113454777884308, 'mean_word_length': 3.0755208333333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '816109', 'n_tokens_mistral': 800, 'n_tokens_neox': 779, 'n_words': 185}