Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
3 registered members (Martin_HH, steyr, alibaba), 509 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: How to apply env-map to level geo ? [Re: Josh_Arldt] #55468
09/23/05 19:22
09/23/05 19:22
Joined: Jun 2005
Posts: 4,875
broozar Offline
Expert
broozar  Offline
Expert

Joined: Jun 2005
Posts: 4,875
cause iīm well gonna make a fool of myself
due to my lack of shader knowledge, i just copied it from anywhere and placed it in my testleve.
no wonder it doesnīt work....


////////////////envmap.fx

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

zWriteEnable=true;
alphaBlendEnable=true;

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
}
}

////////////////main wdl, extract:

bmap envmap = <desertsm+6.tga>;

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

function mtl_env_init()
{
bmap_to_cubemap(mtl.skin1);
mtl.event=mtl_envmap_view;
mtl.enable_view=on;
}

material brushed_metal02 {
skin1=envmap;
event=mtl_env_init;
}

starter load_shaders()
{
d3d_automaterial=1;

effect_load (brushed_metal02, "envmap.fx");

wait(5);
}

//btw, the shader works very well with models =)

so donīt laugh, i am no coder.

Last edited by DaBro0zar; 09/24/05 12:44.
Re: How to apply env-map to level geo ? [Re: broozar] #55469
09/24/05 03:02
09/24/05 03:02
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
I believe that the <mtl_env_init()> function is not getting called by the Event. Therefore, the cubmap is not being generated. Move your init codes into the Starter Function. No entities are assigned this material and so the Event Function will not be executed.

Re: How to apply env-map to level geo ? [Re: Steempipe] #55470
09/24/05 15:33
09/24/05 15:33
Joined: Jun 2005
Posts: 4,875
broozar Offline
Expert
broozar  Offline
Expert

Joined: Jun 2005
Posts: 4,875
now iīm gettin kinda "empty pointer"-error, and the pipe is black as before.

please post what you mean - i just copied my init lines in the starter function, when i leave out the Bmap_to_cubemap thingy, i get no errors butthe image doesnīt change

Re: How to apply env-map to level geo ? [Re: broozar] #55471
09/24/05 17:35
09/24/05 17:35
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
Similar to this....

starter load_shaders()
{
d3d_automaterial=1;
effect_load (brushed_metal02, "envmap.fx");
wait(5);

bmap_to_cubemap(bmap_to_mipmap(brushed_metal02.skin1));

}

Re: How to apply env-map to level geo ? [Re: Steempipe] #55472
09/24/05 20:10
09/24/05 20:10
Joined: Jun 2005
Posts: 4,875
broozar Offline
Expert
broozar  Offline
Expert

Joined: Jun 2005
Posts: 4,875
hmm... tried it several times, but makes no difference at all
still a fine, plain grey.

Re: How to apply env-map to level geo ? [Re: broozar] #55473
09/24/05 20:44
09/24/05 20:44
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
make a small test level if you can and email it to me (in my profile). I'll try to help.

Re: How to apply env-map to level geo ? [Re: Steempipe] #55474
09/25/05 08:47
09/25/05 08:47
Joined: Jun 2005
Posts: 4,875
broozar Offline
Expert
broozar  Offline
Expert

Joined: Jun 2005
Posts: 4,875
wow, thatīs service

sending it.

Re: How to apply env-map to level geo ? [Re: broozar] #55475
09/25/05 09:58
09/25/05 09:58
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
DaBro0zar: You have mail.

Re: How to apply env-map to level geo ? [Re: Steempipe] #55476
09/25/05 10:24
09/25/05 10:24
Joined: Jun 2005
Posts: 4,875
broozar Offline
Expert
broozar  Offline
Expert

Joined: Jun 2005
Posts: 4,875
wonderful! amazing!
if i hadnīt rated you 5 stars a long time before, iīd do it immediately
a screenshot wouldnīt make much sense, itīs only visible in motion.

[EDIT]
well, i guess i should share the code. iīll set up a small demo cube soon. steempipe, i hope you donīt mind.

Last edited by DaBro0zar; 09/25/05 10:32.
Re: How to apply env-map to level geo ? [Re: broozar] #55477
09/25/05 10:40
09/25/05 10:40
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
Glad it helped. I encourage sharing your code.

Page 2 of 3 1 2 3

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