Hello, first of all many thanks for the support!
The 'specTrans' Shader also looks great, as you can see on the picture:
But what is the ´specBumpTrans´ shader for? This does not seem to work (only color_Map + Tranparenz_Map).
Or am I doing something wrong? I commented it out in the main.c and assigned it to the cube in the WAD:
In addition, I came across yet another problem. The object with the 'specTrans' Sahder takes on no shadow.
The code is only extended by the shadow function:
///////////////////////////////
#include <acknex.h>
#include <default.c>
//#include <mtlFX.c>
#include <shadows.c>
///////////////////////////////
var shadow_flag = 1; // Einfacher Schatten
MATERIAL *mtlSpecTrans = {
effect = "SpecTrans.fx";
}
MATERIAL *mtlSpecBumpTrans = {
effect = "specBump.fx";
technique = "spec_trans";
}
// Startet Schatten bei dem der Schatten einer Entity
// auch auf sich selber geworfen werden kann.
function setShadow()
{
if (shadow_flag == 1) // Schatten: Stancil mit Eigenschatten
{
// stencil_blur(0);
pssm_run(0);
shadow_stencil = 1;
for(you = ent_next(NULL); you; you = ent_next(you))
{
reset(you, CAST);
set(you, SHADOW);
you.shadow = NULL;
}
}
if (shadow_flag == 2)
{
// Dieser Schatten kann nur aktiviert werden, wenn die
// Grafikkarte Shadermodel 3 oder höher unterstützt.
if (d3d_shaderversion >= 3)
{
// Deaktivieren des PSSM um dessen Parameter ändern zu können.
pssm_run(0);
// stencil_blur(0);
for(you = ent_next(NULL); you; you = ent_next(you)) {
reset(you, CAST);
set(you, SHADOW);
you.shadow = NULL;
}
shadow_stencil = 8;
// Clip-Werte so nah wie möglich zusammenlegen.
camera.clip_near = 30;
camera.clip_far = 3000;
// Fehlerquotienten setzen, dieser Wert wird durch ausprobieren
// optimiert.
pssm_fbias = 0.0005;
pssm_run(3);
}
else
{
printf("Ihre Grafikkarte unterstützt Shader Model 3 nicht!");
}
}
}
void main () {
video_mode = 10;
wait(3);
sun_light = 0;
level_load("spec.wmb");
setShadow();
def_move();
while(!key_esc) {
wait(1);
}
sys_exit(NULL);
}