 
 
 # TODO: Should jitter be generated with a different random distrubition?
-
+{vec3} = require 'vmath'
 
 class BlenderCyclesPBRMaterial
     constructor: (@material) ->
-        {data, _texture_list, @context, scene} = @material
+        {data, _texture_list, _input_list, inputs, @context, scene} = @material
         {blank_texture} = @context.render_manager
         for u in data.uniforms
             switch u.type
                 when 'IMAGE', 'LAMP_SHADOW_MAP'
                     _texture_list.push {value: blank_texture}
+                when 'CUSTOM'
+                    _input_list.push inputs[u.name] = {value: vec3.create()}
         @unfjitter_index = _texture_list.length
         _texture_list.push {value: get_jitter_texture(scene)}
         @unflutsamples_index = _texture_list.length

                when 'LAMP_BLEED_BIAS'
                    code.push "gl.uniform1f(locations[#{loc_idx}],
                        lamps[#{current_lamp}].shadow_options.bleed_bias);"
                else
                    console.log "Warning: unknown uniform", u.varname, \
                        u.type, "of data type", u.datatype

        locations = []
        texture_count = 0
        for u in @material.data.uniforms or []
            if u.type == 'CUSTOM' # custom uniforms are material.inputs
                current_input++
            uloc = gl.getUniformLocation(program, u.varname)
            if not uloc? or uloc == -1
