Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Quad, Ayumi, AndrewAMD), 1,092 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Reflaction map #31799
08/09/04 17:31
08/09/04 17:31
Joined: Mar 2004
Posts: 70
M
Matan_Golan_A6 Offline OP
Junior Member
Matan_Golan_A6  Offline OP
Junior Member
M

Joined: Mar 2004
Posts: 70
hi,
some one can give me a code of Reflaction shading??

thanks!

Last edited by Matan_Golan_A6; 08/09/04 17:34.
Re: Reflaction map [Re: Matan_Golan_A6] #31800
08/09/04 18:23
08/09/04 18:23
Joined: Mar 2004
Posts: 202
Germany
zSteam_ Offline
Member
zSteam_  Offline
Member

Joined: Mar 2004
Posts: 202
Germany
hi
here is my german code :

bmap bcube=<cube+6.tga>;

function mtl_envmap_view()
{
mat_set(mtl.matrix,matViewInv);
mtl.matrix41=0;
mtl.matrix42=0;
mtl.matrix43=0;
}

function mtl_envmap_init()
{
//...maybe you should copy the mat_model properties here...
bmap_to_cubemap(mtl.skin1);
mtl.event=mtl_envmap_view;
mtl.enable_view=on;
}

material mtl_envmap
{
skin1=bcube;
event=mtl_envmap_init;

effect=
"
texture entSkin1;
texture mtlSkin1;
matrix matMtl;
technique envmap
{
pass p0
{
texture[0]=<entSkin1>;
texture[1]=<mtlSkin1>;

zWriteEnable=true;
alphaBlendEnable=false;

colorArg1[0]=Texture;
colorOp[0]=Modulate2x;
colorArg2[0]=Diffuse;

colorArg1[1]=Texture;
textureFactor=0x90FFFFFF; // -> C0=75%, 80=50%, 40=25% (alpha)
colorOp[1]=blendFactorAlpha;
addressU[1]=Clamp;
addressV[1]=Clamp;
texCoordIndex[1]=cameraSpaceReflectionVector;
textureTransformFlags[1]=Count3;
textureTransform[1]=<matMtl>; // transform camera space back to world space
}
}
";
}

action cubic
{
my.shadow=on;
my.material=mtl_envmap;
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////

function mtl_enmap_view()
{
mat_set(mtl.matrix,matViewInv);
mtl.matrix41=0;
mtl.matrix42=0;
mtl.matrix43=0;
}

function mtl_enmap_init()
{
//...maybe you should copy the mat_model properties here...
bmap_to_cubemap(mtl.skin1);
mtl.event=mtl_enmap_view;
mtl.enable_view=on;
}

material mtl_enmap
{
skin1=bcube;
event=mtl_enmap_init;

effect=
"
texture entSkin1;
texture mtlSkin1;
matrix matMtl;
technique enmap
{
pass p0
{
texture[0]=<entSkin1>;
texture[1]=<mtlSkin1>;

zWriteEnable=true;
alphaBlendEnable=false;

colorArg1[0]=Texture;
colorOp[0]=Modulate2x;
colorArg2[0]=Diffuse;

colorArg1[1]=Texture;
colorOp[1]=blendCurrentAlpha;
addressU[1]=Clamp;
addressV[1]=Clamp;

texCoordIndex[1]=cameraSpaceReflectionVector;
textureTransformFlags[1]=Count3;
textureTransform[1]=<matMtl>; // transform camera space back to world space
}
}
";
}

action chrom
{
my.shadow=on;
my.material=mtl_enmap;
}


A6 Commercial 6.50.6
Re: Reflaction map [Re: zSteam_] #31801
08/10/04 04:06
08/10/04 04:06
Joined: Mar 2004
Posts: 70
M
Matan_Golan_A6 Offline OP
Junior Member
Matan_Golan_A6  Offline OP
Junior Member
M

Joined: Mar 2004
Posts: 70
its very nice effect but i didnt ment this i ment reflaction like mirror

Re: Reflaction map [Re: Matan_Golan_A6] #31802
08/10/04 11:41
08/10/04 11:41
Joined: Jul 2002
Posts: 2,813
U.S.
Nadester Offline

Expert
Nadester  Offline

Expert

Joined: Jul 2002
Posts: 2,813
U.S.
Use the A6 Pro's mirrors to make flat surfaces reflective. True reflections on models and such is way way too costly on the fps for real time games.


--Eric
Re: Reflaction map [Re: Nadester] #31803
08/10/04 16:16
08/10/04 16:16
Joined: Mar 2004
Posts: 70
M
Matan_Golan_A6 Offline OP
Junior Member
Matan_Golan_A6  Offline OP
Junior Member
M

Joined: Mar 2004
Posts: 70
but i want to apply mirror on entity...
there is some way to get reflect what you see?
without env_map?

Re: Reflaction map [Re: Matan_Golan_A6] #31804
08/10/04 17:24
08/10/04 17:24
Joined: Nov 2003
Posts: 677
There
Julius Offline
Developer
Julius  Offline
Developer

Joined: Nov 2003
Posts: 677
There
i'm pretty sure you can't do realtime reflections on entities without CEM (Cubic Environment Mapping)

Julian


flabadabadab.
Re: Reflaction map [Re: Julius] #31805
08/10/04 19:02
08/10/04 19:02
Joined: Jul 2002
Posts: 5,181
Austria
Blattsalat Offline
Senior Expert
Blattsalat  Offline
Senior Expert

Joined: Jul 2002
Posts: 5,181
Austria
you could make a realitme screenshot (not really a shot but camera .views) every frame and render to texture the result.

I think marco did somehting like that a time ago with a ball......might ask him for help.

Re: Reflaction map [Re: Blattsalat] #31806
08/10/04 22:00
08/10/04 22:00
Joined: Jul 2004
Posts: 1,710
MMike Offline
Serious User
MMike  Offline
Serious User

Joined: Jul 2004
Posts: 1,710
I tryed that with a cube
and it is a bit slow..but its cool

Re: Reflaction map [Re: MMike] #31807
08/11/04 00:43
08/11/04 00:43
Joined: Jul 2002
Posts: 2,813
U.S.
Nadester Offline

Expert
Nadester  Offline

Expert

Joined: Jul 2002
Posts: 2,813
U.S.
Yes, Marco wrote a tidbit for RenderToTexture on entities a while ago for lower Gamestudio versions. (Though A6 Pro already has the feature I believe).

Also, Cubic Enviromental Mapping is just a fake, it doesn't actually create realtime reflections.


--Eric
Re: Reflaction map [Re: zSteam_] #31808
08/12/04 03:43
08/12/04 03:43
Joined: Mar 2004
Posts: 70
M
Matan_Golan_A6 Offline OP
Junior Member
Matan_Golan_A6  Offline OP
Junior Member
M

Joined: Mar 2004
Posts: 70
if you cant find anything maybe some one have code to Water-Shader?


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