Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (AndrewAMD, Ayumi, NewbieZorro), 14,141 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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