Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, The_Judge, Grant), 898 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
color maipulation with render to texture... #23425
02/21/04 11:26
02/21/04 11:26
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
hi! hope u dont mind me that i first give you the shots:









and two closer looks



and here the script i used, i commented out the different versions. simply uncomment and comment to swap between effects. and go and play around there. change instructions for example and look what happens. most differencies above came up when changing only one instruction
bmap nmap1=<nmap1.tga>;

view render1 { //generate ultimate camera fx - view
layer = 10;
pos_x = 0;
pos_y = 0;
size_x = 512;
size_y = 384;
arc = 90;
aspect = 1;
offset_x = 0;
offset_y = 0;
ambient = 0; //ajust the brightness of ultimate camera fx
fog = 0;
clip_near=1;
clip_far=2000;
flags = visible;

}
view render2 { //generate ultimate camera fx - view
layer = 11;
pos_x = 0;
pos_y = 0;
size_x = 512;
size_y = 384;
arc = -90;
aspect = 1;
offset_x = 0;
offset_y = 0;
ambient = 0; //ajust the brightness of ultimate camera fx
fog = 0;
clip_near=1;
clip_far=2000;
flags = visible;

}
material mat_screen {
ambient_red=2;
ambient_green=12;
ambient_blue=49;
diffuse_red=69;
diffuse_green=51;
diffuse_blue=12;
specular_red=69;
specular_green=69;
specular_blue=69;
emissive_red=58;
emissive_green=56;
emissive_blue=55;
power=7;
skin1=nmap1;
scale1=.1;
effect="

texture entSkin1;
texture entSkin2;
texture mtlSkin1;
//content //register cn

matrix matWorld; //c0
matrix matView; //c4
matrix matViewInv; //c8
matrix matProj; //c12
matrix matWorldView; //c16
matrix matWorldViewProj; //c20
matrix matViewProj; //c24
matrix matMtl; //c28
vector vecSunDir; //c29
vector vecAmbient; //c30
vector vecDiffuse; //c31
vector vecSpecular; //c32
vector vecEmissive; //c33
vector vecTime; //c34
vector vecFog; //c35
vector vecLight; //c36
vector vecViewPort; //c37
vector vecViewPos; //c38
vector vecViewDir; //c39
vector vecCycle; //c40
vector vecSkill41; //c41
technique render_to_texture {
pass p0 {
Texture[0] = <entSkin1>;
Texture[1] = <entSkin2>;
Texture[2] = <mtlSkin1>;


CullMode=1; // show every side of a polygon
ShadeMode=0; //0=smooth 1=flat shaded
FillMode=0; //0=filled 1=points 2=lines
VertexShaderConstant[20]=<matWorldViewProj>;
VertexShaderConstant[36]=<vecLight>;
VertexShaderConstant[28]=<matMtl>;
VertexShaderConstant[31]=<vecDiffuse>;
VertexShaderConstant[34]=<vecTime>;
VertexShaderConstant[40]=<vecCycle>;

VertexShader=
decl
{
stream 0;
float v0[3];
float v3[3];
float v7[3];
float v8[3];
}
asm
{
vs.1.1
m4x4 oPos,v0,c20

sub r0,c36,v0

dp3 r0.w,r0,r0
rsq r0.w,r0.w
mul r0,r0,r0.w
mov oT0,v7
// add oT0,v7,c40 //use for motion if pass p1 is 'on'
mov oT1,v7
mov oD0,r0

add oT2,v7,c28

};
PixelShaderConstant[0]=<vecTime>;
PixelShaderConstant[1]=<vecCycle>;
PixelShader=
asm {

// colored(t3) and b/w(t1,t2) texture blend
ps.1.4
texld r0,t0
texld r1,t1
texcrd r2.rgb,t2

bem r3.rg,r0,r2

phase

texld r0,t0
texld r1,t1
texld r2,t2
texld r3,t3
add_d2 r0,1-r0,r1
//mul_x2 r0,r0,v0
dp3 r0,r0,r2
add r4,r0,r3
mul r0,r0,r2
add r0,r0,r4

// black and white texture blender
// ps.1.4
//
// texld r0,t0
// texld r1,t1
// texld r2,t2
//
// add_d2 r0,1-r0,r1
// add r0,r0,v0
// dp3 r0,r0,r2

//red metal with colorflake
// ps.1.4
//
// texld r0,t0
// texld r1,t1
// texld r2,t2
//
// add_d2 r0,1-r0,r1
// //add r0,r0,v0
// sub_x2 r0,r0,r2

//color_plate
// ps.1.3
//
// tex t0
// tex t1
// texcoord t2
// lrp r0,t0,t1,1-t2
};
}
// pass p1 {
// Texture[0] = <entSkin1>;
// Texture[1] = <entSkin2>;
// Texture[2] = <mtlSkin1>;
//
//
// CullMode=1; // show every side of a polygon
// ShadeMode=0; //0=smooth 1=flat shaded
// FillMode=0; //0=filled 1=points 2=lines
// VertexShaderConstant[20]=<matWorldViewProj>;
// VertexShaderConstant[36]=<vecLight>;
// VertexShaderConstant[28]=<matMtl>;
// VertexShaderConstant[31]=<vecDiffuse>;
// VertexShaderConstant[34]=<vecTime>;
// VertexShaderConstant[40]=<vecCycle>;
// VertexShaderConstant[41]={0.60,0.69,0.69,0.69};
//
// VertexShader=
// decl
// {
// stream 0;
// float v0[3];
// float v3[3];
// float v7[3];
// float v8[3];
// }
// asm
// {
// vs.1.1
// m4x4 oPos,v0,c20
//
// sub r0,c36,v0
//
// dp3 r0.w,r0,r0
// rsq r0.w,r0.w
// mul r0,r0,r0.w
//
// mov oT0,v7
// add oT1,v7,c34
// mov oD0,r0
//
// add oT2,v7,c40
//
// };
// PixelShaderConstant[0]=<vecTime>;
// PixelShaderConstant[1]=<vecCycle>;
// PixelShader=
// asm {
//
// //color_plate
// ps.1.3
//
// tex t0
// tex t1
// texcoord t2
// lrp r0,t2,t1,t0
// };
// }
}
";
}
action screen_func {
my.material=mat_screen;
my.metal=1;
my.transparent=0;
while(1) {
vec_set(render1.x,my.x);
vec_set(render1.pan,camera.pan);
vec_set(render2.x,camera.x);
vec_set(render2.pan,camera.pan);
render1.tilt+=10;
render2.tilt+=10;
render1.bmap=bmap_for_entity(my,0);
render2.bmap=bmap_for_entity(my,1);
wait(1);
}
}

have fun! btw u may want to use some panning on the objects


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: color maipulation with render to texture... [Re: ello] #23426
02/22/04 07:02
02/22/04 07:02
Joined: May 2002
Posts: 2,541
Berlin
EX Citer Offline
Expert
EX Citer  Offline
Expert

Joined: May 2002
Posts: 2,541
Berlin
Verkaufst du zu dem Effekt auch die 3D Brillen Hübsch, aber du weißt ja(?) ich steh mehr auf realistische Effekte (Metall, LAck, Wasser, Licht, BumpMap und sowas).
MfG EX


:L
Re: color maipulation with render to texture... [Re: EX Citer] #23427
02/22/04 07:11
02/22/04 07:11
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
exciter, du kannst doch jede textur verwenden die du möchtest. hier wird die kamerasicht als textur benutzt und eine dritte textur beigemischt. du hast also eine basis um dir metalleffekte mit z.b. rostigen stellen zu machen.

es ging mir hierbei auch eher darum, das man den view mit den shadern beeinflusst. wenn du nähmlich eine kugel nimmst und diese immer aktuell auf der kammeraposition hältst, dann kannst du den gesamten view z.b. grün machen, oder differenz effekte machen. nachtsichtgerät und so weiter...

man beachte auch die endlos schleife im view

Last edited by ello; 02/22/04 07:12.

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: color maipulation with render to texture... [Re: ello] #23428
02/22/04 17:49
02/22/04 17:49
Joined: Jun 2003
Posts: 1,017
Germany
T
Thomas_Nitschke Offline
Senior Developer
Thomas_Nitschke  Offline
Senior Developer
T

Joined: Jun 2003
Posts: 1,017
Germany
Hi,
also ich kapier wirklich nicht viel von Shadern, aber die Shots machen was her. Zwar kann man nicht feststellen was auf den Shots eigentlich dargestellt wird, aber das sind dann halt unrealistische Effekte
Und du hast ja gesagt, dass der Shader auch für realistische Effekte anwendbar ist.
Aber wenn ich das richtig kapiert hab, braucht man die Pro wegen render_to_texture oder?

Last edited by The Matrix; 02/22/04 17:50.

Formerly known as The Matrix - ICQ 170408644 I've been here for much longer than most people think. So where's my "Expert" status?
Re: color maipulation with render to texture... [Re: Thomas_Nitschke] #23429
02/23/04 16:31
02/23/04 16:31
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
die pro ist aber auch nur für das render_to_texture nötig. die vertex und pixelshader haben nix mit der version zu tun. die kann man auch ohne den gerenderten view verwenden. viel spaß damit


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.

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