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
2 registered members (OptimusPrime, AndrewAMD), 14,580 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
[REQ] car paint shader #186863
03/04/08 00:12
03/04/08 00:12

A
Anonymous
Unregistered
Anonymous
Unregistered
A



Is there a car paint shader like the one used by MetalRay and 3ds max?

Thank you
Malice

Re: [REQ] car paint shader [Re: ] #186864
03/04/08 09:22
03/04/08 09:22
Joined: Jun 2005
Posts: 4,875
broozar Offline
Expert
broozar  Offline
Expert

Joined: Jun 2005
Posts: 4,875
not yet. most people use a fake reflection (environment mapping) for that -> http://www.coniserver.net/wiki/index.php/Cubic_Enviroment_Shading_Shader

Re: [REQ] car paint shader [Re: broozar] #186865
03/04/08 18:17
03/04/08 18:17
Joined: Apr 2006
Posts: 14
S
Sidarta Offline
Newbie
Sidarta  Offline
Newbie
S

Joined: Apr 2006
Posts: 14
Hi!

I'm having issues with cube enviroment shaders in a racing game too. I'm trying, without sucess, to move the enviroment texture following x/y coordinates. Example: in a racing game, a enviroment texture should move with the car's velocity. But according to the shader's logic in the link given by broozar, the material just render the first time and the texture still in that position.

Here's a piece of the code:

function mtl_envmap_view()
{
mat_set(mtl.matrix,matViewInv);

mtl.matrix41=0;
mtl.matrix42=0;
mtl.matrix43=0;
}

Using this code, I tried to change the '0' values to floatd(my.y*(-1)/10, 64) and that resulted in a empty pointer error. So I tried this:

if(me!=NULL)
{
mtl.matrix41=floatd(my.y*(-1)/10, 64);
mtl.matrix42=0;
mtl.matrix43=floatd(my.x*(-1)/10, 64);
}

With that, the game works, but the texture still static. Please, is there some way to make the enviroment texture move?

Thank you very much!

Re: [REQ] car paint shader [Re: Sidarta] #186866
03/04/08 21:47
03/04/08 21:47
Joined: Jul 2006
Posts: 503
Australia
A
adoado Offline

User
adoado  Offline

User
A

Joined: Jul 2006
Posts: 503
Australia
Not sure, maybe try this:

material EnvMaterial
{
event = the_material_function;
effect = "theeffect.fx";
gflags = ENABLE_VIEW;
}

I think if you want it to update every frame, you must add the flag ENABLE_VIEW..

Hope it helps, ^^
Adoado


Visit our development blog: http://yellloh.com
Re: [REQ] car paint shader [Re: adoado] #186867
03/05/08 13:27
03/05/08 13:27
Joined: Apr 2006
Posts: 14
S
Sidarta Offline
Newbie
Sidarta  Offline
Newbie
S

Joined: Apr 2006
Posts: 14
Thank you very much for your answer, Adoado! This didn't helped me with this problem, but it helped me to make some changes in the enviroment mapping to make it faster! That's really nice, you're great!! ^o^

But I'm still trying to make the enviroment texture move with the x/y position... I'm trying to change the matrix, but it still resulting in a empty pointer error. Does anyboy have a hint of how can I solve this problem?

Thanks, everybody!

Re: [REQ] car paint shader [Re: Sidarta] #186868
03/06/08 07:31
03/06/08 07:31
Joined: Jul 2006
Posts: 503
Australia
A
adoado Offline

User
adoado  Offline

User
A

Joined: Jul 2006
Posts: 503
Australia
np, glad it helped

Sorry, as for your other problem I have no idea


Visit our development blog: http://yellloh.com

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