|
|
Re: pp_monochrome?
[Re: KMS]
#213688
06/30/08 07:54
06/30/08 07:54
|
Joined: Oct 2007
Posts: 5,211 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
|
pp_set(mtl_monochrome,camera);
you need to include mtlView.c in your project.(not sure)
Last edited by Quadraxas; 06/30/08 07:55.
3333333333
|
|
|
Re: pp_monochrome?
[Re: KMS]
#213835
07/01/08 07:15
07/01/08 07:15
|
Joined: Jul 2006
Posts: 511 Germany,NRW
KMS
OP
User
|
OP
User
Joined: Jul 2006
Posts: 511
Germany,NRW
|
The Problem is fixed with the help of a friend and it works fine with A7com! You have to write into your mainscript:
SW_camera_Init();//Init the effect PP_Toggle_OnOff();//Show the effect
into a included script you write:
////////////////////////////////////////// Monochrome//////////////////////////////////////////// material Monochrome_mat { effect = "monochrome.fx"; }
view SW_camera { }
entity PP_Quad { type = <PPE_Quad.tga>; layer = 1; view = camera; x = 878; y = 0; z = 0;
scale_x = 1; scale_y = 1; flags=visible; }
function PP_Init_startup() { SW_camera.bmap = bmap_for_entity(PP_Quad,0); SW_camera.arc=60; SW_camera.clip_far=100000; }
function SW_camera_Init() { PP_Quad.material = Monochrome_mat; }
function PP_Toggle_OnOff() { if(PP_Quad.visible == on) { SW_camera.visible = off; PP_Quad.visible = off; }else { SW_camera.visible = on; PP_Quad.visible = on; while(PP_Quad.visible == on) { vec_set(SW_camera.x,camera.x); vec_set(SW_camera.pan,camera.pan); wait(1); } } }
on_t = PP_Toggle_OnOff;
For the "entity PP_Quad" you need a white tga-bitmap 1024*768!This Bitmap and the monochrome.fx-file has to be in your gamefolder! I think,other postprocessing-effects will also work with it,but I didn't test it until now.
Last edited by KMS; 07/01/08 07:18.
|
|
|
Re: pp_monochrome?
[Re: Slin]
#213847
07/01/08 07:56
07/01/08 07:56
|
Joined: Jul 2006
Posts: 511 Germany,NRW
KMS
OP
User
|
OP
User
Joined: Jul 2006
Posts: 511
Germany,NRW
|
You are right and I will learn C-Lite,when I finished my projekt!During a work I never do a Gs-update or change the Script-language.
Last edited by KMS; 07/01/08 07:59.
|
|
|
Re: pp_monochrome?
[Re: KMS]
#214607
07/05/08 18:19
07/05/08 18:19
|
Joined: Jul 2006
Posts: 511 Germany,NRW
KMS
OP
User
|
OP
User
Joined: Jul 2006
Posts: 511
Germany,NRW
|
Can someone fix the colour bug using the monochrome shader?The bug appears on all models that use bumpmapping. Thats the bump-effect: extern texture entSkin1; extern texture entSkin2; extern texture entSkin3; extern texture entSkin4; extern texture mtlSkin1; extern texture mtlSkin2; extern texture mtlSkin3; extern texture mtlSkin4; extern float4x4 matMtl; extern float4x4 matViewInv; technique untitled //Author: unknown { pass p0 { //TEXTURE STAGE [0] Texture[0] = <entSkin2>; ColorOp[0] = DotProduct3; //TEXTURE STAGE [1] Texture[1] = <entSkin1>; ColorOp[1] = Modulate; } }; That's the monochrome: extern texture entSkin1; extern texture entSkin2; extern texture entSkin3; extern texture entSkin4; extern texture mtlSkin1; extern texture mtlSkin2; extern texture mtlSkin3; extern texture mtlSkin4; extern float4x4 matMtl; extern float4x4 matViewInv; technique untitled //Author: unknown { pass p0 { //TEXTURE STAGE [0] Texture[0] = <entSkin2>; ColorOp[0] = DotProduct3; //TEXTURE STAGE [1] Texture[1] = <entSkin1>; ColorOp[1] = Modulate; } };
Last edited by KMS; 07/05/08 18:26.
|
|
|
Re: pp_monochrome?
[Re: Slin]
#214651
07/06/08 05:38
07/06/08 05:38
|
Joined: Jul 2006
Posts: 511 Germany,NRW
KMS
OP
User
|
OP
User
Joined: Jul 2006
Posts: 511
Germany,NRW
|
Sorry,I selected the wrong shader!I solved the problem with a 3.texture,witch is monochrom.By toggle to monochrom-modus, I change skin0 to skin2.That works fine! Thats the monochrom: texture entSkin1; sampler postTex = sampler_state { texture = (entSkin1); MinFilter = linear; MagFilter = linear; MipFilter = linear; AddressU = Clamp; AddressV = Clamp; }; float4 Monochrom_PS(float2 tex : TEXCOORD0) : COLOR { float4 Color = tex2D(postTex,tex); Color.rgb = (Color.r+Color.g+Color.b)/3.0f; return Color; } technique tech_00 { pass pass_00 { VertexShader = null; PixelShader = compile ps_2_0 Monochrom_PS(); } } technique tech_01 { pass pass_00 { Texture[0] = <entSkin1>; } }
|
|
|
|