4 registered members (ozgur, Ayumi, VHX, monarch),
1,161
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
2 questions - PostProcessing and Level geometrie
#67645
03/22/06 07:41
03/22/06 07:41
|
Joined: Feb 2005
Posts: 728 Germany, Berlin
Asse
OP
Developer
|
OP
Developer
Joined: Feb 2005
Posts: 728
Germany, Berlin
|
Hi, now I've installed 3DGS after a half year again to explore the fascinating world of shaders with it and I must say it's veeery easy to assign them to models But I've already two questions! PostProcessing: I've asked mk about PostProcessing to write fullscreen effects and he said that I need the Sylex3.0 plugin for this. Is it right or is there another way to implement them because you could write very cool effects with them!? Level geometrie: Now assigning shaders to entities is very easy but what's about assigning them to level geometrie? Can someone please give me a hint for this? Greetings, Asse.
A6.31.4 Commercial
AMD Athlon XP 2400+
Radeon 9800Pro
512MB DDR-Ram
Windows XP Professional SP2
3D GameStudio Magazin
|
|
|
Re: 2 questions - PostProcessing and Level geometr
[Re: ello]
#67647
03/22/06 08:25
03/22/06 08:25
|
Joined: Feb 2005
Posts: 728 Germany, Berlin
Asse
OP
Developer
|
OP
Developer
Joined: Feb 2005
Posts: 728
Germany, Berlin
|
That's a word man, didn't knew that rendering the screen to a texture within the engine is possible. Thanks. Btw. I found the shadercollection and applied my own shader to level geometrie. When I find a way to display the framerate I'll see if it's too slow or not
A6.31.4 Commercial
AMD Athlon XP 2400+
Radeon 9800Pro
512MB DDR-Ram
Windows XP Professional SP2
3D GameStudio Magazin
|
|
|
Re: 2 questions - PostProcessing and Level geometr
[Re: Asse]
#67648
03/22/06 08:37
03/22/06 08:37
|
Joined: Feb 2005
Posts: 728 Germany, Berlin
Asse
OP
Developer
|
OP
Developer
Joined: Feb 2005
Posts: 728
Germany, Berlin
|
Hehe, it works but is absolutely slow (I can count the fps per minute ). Maybe I toke the wrong commands? But I think this is no good solution since the manual says that bmap_for_screen is slow, too. Code:
bmap_for_screen(bmap_for_entity(entScreen, 0), 1, 0);
A6.31.4 Commercial
AMD Athlon XP 2400+
Radeon 9800Pro
512MB DDR-Ram
Windows XP Professional SP2
3D GameStudio Magazin
|
|
|
Re: 2 questions - PostProcessing and Level geometr
[Re: ello]
#67650
03/22/06 12:15
03/22/06 12:15
|
Joined: Feb 2005
Posts: 728 Germany, Berlin
Asse
OP
Developer
|
OP
Developer
Joined: Feb 2005
Posts: 728
Germany, Berlin
|
Hm, I think camera.bmap=bmap_for_entity(rv_mdl,0); only copies the entities skin to the camera, right? But how do I render to the entities skin?
A6.31.4 Commercial
AMD Athlon XP 2400+
Radeon 9800Pro
512MB DDR-Ram
Windows XP Professional SP2
3D GameStudio Magazin
|
|
|
Re: 2 questions - PostProcessing and Level geometr
[Re: ello]
#67652
03/22/06 15:07
03/22/06 15:07
|
Joined: Feb 2005
Posts: 728 Germany, Berlin
Asse
OP
Developer
|
OP
Developer
Joined: Feb 2005
Posts: 728
Germany, Berlin
|
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.
A6.31.4 Commercial
AMD Athlon XP 2400+
Radeon 9800Pro
512MB DDR-Ram
Windows XP Professional SP2
3D GameStudio Magazin
|
|
|
|