Sorry, but it doesn't work for me. Here's my code:
Code:
////////////////////////////////////////////////////////////////////////////////////
// SHADER VIEWER
////////////////////////////////////////////////////////////////////////////////////
path "models";
path "effects";
var mouse_pointer = 2;
string level_Scene = <scene.wmb>;
entity* ent_Soldier;
bmap dummy = <texture.bmp>;
////////////////////////////////////////////////////////////////////////////////////
// SHADER VIEWER -> FUNCTIONS -> SETUP MODEL
////////////////////////////////////////////////////////////////////////////////////
material effect01
{
effect = "postprocess.fx";
}
function func_Model()
{
my.pan = 300;
my.shadow = on;
while(!ent_Soldier)
{
wait(1);
}
while(me != null)
{
ent_animate(me, "stand", my.skill21, anm_cycle);
my.skill21 %= 100;
my.skill21 += 0.7 * time;
wait(1);
}
}
function func_ModelLoad()
{
ent_Soldier = ent_create("soldier1.mdl", vector(0, 125, 0), func_Model);
ent_Soldier.material = effect01;
}
function func_ModelRotation()
{
while(mouse_right == 1)
{
mouse_pointer = 3;
ent_Soldier.pan += mouse_force.x * 2;
ent_Soldier.tilt += mouse_force.y * 2;
wait(1);
}
mouse_pointer = 2;
}
////////////////////////////////////////////////////////////////////////////////////
// SHADER VIEWER -> FUNCTIONS -> MAIN
////////////////////////////////////////////////////////////////////////////////////
function main()
{
video_set(1000, 675, 32, 2);
video_window(nullvector, vector(1000, 675, 0), 0, "Shader Viewer");
level_load(level_Scene);
wait(3);
mouse_mode = 1;
camera.x = 0;
camera.y = 0;
camera.z = 0;
camera.pan = 90;
camera.tilt = 0;
camera.roll = 0;
func_ModelLoad();
while(!ent_Soldier)
{
wait(1);
}
camera.bmap = bmap_for_entity(ent_Soldier, 0);
while(0)
{
mouse_pos.x = pointer.x;
mouse_pos.y = pointer.y;
wait(1);
}
}
on_mouse_right func_ModelRotation;
And a very simple effect:
Code:
//--------------------------------------------------------------//
// Constants
//--------------------------------------------------------------//
float4x4 matWorldViewProj;
//--------------------------------------------------------------//
// Vertex procesing
//--------------------------------------------------------------//
struct VS_INPUT
{
float4 Position: POSITION0;
float2 TexCoords: TEXCOORD0;
};
struct VS_OUTPUT
{
float4 Position: POSITION0;
float2 TexCoords: TEXCOORD0;
};
VS_OUTPUT vs_main(VS_INPUT Input)
{
VS_OUTPUT Output;
Output.Position = mul(Input.Position, matWorldViewProj);
Output.TexCoords = Input.TexCoords;
return Output;
}
//--------------------------------------------------------------//
// Pixel processing
//--------------------------------------------------------------//
texture entSkin1;
sampler Texture0 = sampler_state
{
Texture = <entSkin1>;
AddressU = clamp;
AddressV = clamp;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
};
float4 ps_main(float2 TexCoords: TEXCOORD0): COLOR0
{
return tex2D(Texture0, TexCoords);
}
//--------------------------------------------------------------//
// Technique Section for Effect Group 1
//--------------------------------------------------------------//
technique Effect1
{
pass Pass_1
{
VertexShader = compile vs_1_1 vs_main();
PixelShader = compile ps_1_1 ps_main();
}
}
It's not a screen aligned quad but that shouldn't does matter. I just want to test it.