This really isnt going well at all.

Currently I have this:
Code:
////////////////////////////////////////////////////////
// Copyright 2006 by Taco Cohen. All rights reserved
// 2007 adapted to A7 / lite-C by jcl
////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>
MATERIAL* mtlNormal =
{
ambient_red = 0; // The ambient color - a dark grey.
ambient_green = 0;
ambient_blue = 0;
effect = "test.fx"; // The effect file containing the vertex shader, pixel shader and technique.
// flags = TANGENT;
// flags = AUTORELOAD; // allows to edit the shader at runtime
}
function main()
{
// Load an empty level, and create a model :
fps_max = 90;
vec_set(sun_color, vector(0,255,0));
level_load("test.wmb");
wait(2);
ENTITY* ent = ent_create("blob.mdl",vector(0,0,0),NULL);
ENTITY* light = ent_create(NULL, vector(10,0,0), NULL);
light.lightrange = 100;
ent.material = mtlNormal;
while(1)
{
// sun_angle.pan += 1.25 * time_step;
ent.pan -= 2.25 * time_step;
ent.tilt -= 1.1 * time_step;
wait(1);
}
}
My map "test.wmb" has got a room. If I do not add a light (thorugh the editor), then the sunlight is visible and everything is more or less magically illuminated. If I however add a light, then the sunlight is gone for some reason. Adding a dynamic light by code doesnt seem to do anything. When not having a light (from editor) in the scene, everything is illuminated by sunlight or something, so I cant see if the code-created light is really there. When adding a light (from editor) somewhere, then everything is dark (except where i added the editor-light), so I guess the code-light really doesnt work.
I also noticed that the ambient lightning of objects wearing test.fx seem to not care about the ambient lightning set in lite-c. Even though all at 0, the model is bright.
So... These are my questions now

:
Why does sunlight disappear when adding in a light?
How can I have both sunlight and "local" lights?
Why doesn't your shader care about sun_color? How can I make it aware of it?

(Something I noticed...)
How do I make Matt's shader aware of the ambient lightning set in lite-c?
And I still need help with getting Matt's shader to work obviously...