Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 816 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
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 Offline OP
Developer
Asse  Offline 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: Asse] #67646
03/22/06 08:08
03/22/06 08:08
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
basically you need to render the view (camera or additional extra view) into a texture using bmap_for_entity instruction. the used model in most cases is a screen aligned quad (screen entity) and this entity has the postprocess shader applied to it.

about level geometry and shaders: better forget it, its slow and in most cases not suitable...


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
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 Offline OP
Developer
Asse  Offline 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 Offline OP
Developer
Asse  Offline 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: Asse] #67649
03/22/06 09:21
03/22/06 09:21
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
oh, no, not like this. more like this:

Code:

material mat_vFx
{
effect="vFx1.fx";
}

entity rv_mdl
{
type = <quad.mdl>;
layer = 1;
view = camera;
x = 100;
y = 0;
z = 0;
material=mat_vFx;
}

//use this funtion to enable/disable the postprocess:
function update_vFx(a) {
if (a==1)
{
rv_mdl.visible = 1;
camera.bmap=bmap_for_entity(rv_mdl,0);
}
else
{
rv_mdl.visible = 0;
camera.bmap=null;
}
}




www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
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 Offline OP
Developer
Asse  Offline 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: Asse] #67651
03/22/06 12:23
03/22/06 12:23
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
no, this shows the camera content in the skin.


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
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 Offline OP
Developer
Asse  Offline 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
Re: 2 questions - PostProcessing and Level geometr [Re: Asse] #67653
03/22/06 15:19
03/22/06 15:19
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
what happens ?? black model? i will create a small testlevel for you tonight and send it to you tomorrow, if you didnt got it working until then...


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
Re: 2 questions - PostProcessing and Level geometr [Re: ello] #67654
03/22/06 15:43
03/22/06 15:43
Joined: Feb 2005
Posts: 728
Germany, Berlin
Asse Offline OP
Developer
Asse  Offline OP
Developer

Joined: Feb 2005
Posts: 728
Germany, Berlin
Neither black nor white, it is just rendered with it's skin

I'll try to get it working so you hasn't to do a night shift


A6.31.4 Commercial AMD Athlon XP 2400+ Radeon 9800Pro 512MB DDR-Ram Windows XP Professional SP2 3D GameStudio Magazin
Page 1 of 2 1 2

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1