Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,320 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Mino, squik, AemStones, LucasJoshua, Baklazhan
19061 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Some questions regarding shaders in 3D Game Studio #398890
04/08/12 15:15
04/08/12 15:15
Joined: Mar 2012
Posts: 43
J
Juggernaut Offline OP
Newbie
Juggernaut  Offline OP
Newbie
J

Joined: Mar 2012
Posts: 43
Hello,

I have some queries regarding how to apply shaders -

1.Suppose I have downloaded a shader file from the internet. Now can I apply that shader effect to a particular region or regions of an object or mesh and not the whole surface of the object / mesh ? If so, how ?

2.Can shaders be applied to the screen itself ( not the objects in the screen ) ? If true, how ?

3.Thirdly applying different shaders to different portion of a screen - possible or not ? If possible then how ?

4.Fourthly - can I pass data - variable values / textures etc. at run - time from the Lite-C code to the shader or in other words can the loaded shader be manipulated at run ? If possible then how ?

Thanks,

Re: Some questions regarding shaders in 3D Game Studio [Re: Juggernaut] #399008
04/10/12 08:53
04/10/12 08:53
Joined: Mar 2012
Posts: 43
J
Juggernaut Offline OP
Newbie
Juggernaut  Offline OP
Newbie
J

Joined: Mar 2012
Posts: 43
Nobody ? !!!!!! Nobody knowss answers to these questions !!!!!!!

Re: Some questions regarding shaders in 3D Game Studio [Re: Juggernaut] #399009
04/10/12 09:16
04/10/12 09:16

C
chris_oat
Unregistered
chris_oat
Unregistered
C



Im not a Shader Expert but maybe i can answer some:

1. Shader-File as in the fx-Code? I dont know any way to assign a shader only to a region of a mesh, but maybe you can create your object out of many meshes and give each another shader.

2. Shaders on Screen are called Postprocessing-shaders as far as i know. GS offers alot of those already like Bloom.
to apply a shader on screen read the manual, there is an example.

3. i dont think so... but maybe.

4. i think yes, but i dont know how as im not a shader-programmer laugh

Re: Some questions regarding shaders in 3D Game Studio [Re: ] #399012
04/10/12 10:00
04/10/12 10:00
Joined: Mar 2012
Posts: 43
J
Juggernaut Offline OP
Newbie
Juggernaut  Offline OP
Newbie
J

Joined: Mar 2012
Posts: 43
Originally Posted By: chris_oat
Im not a Shader Expert but maybe i can answer some:

1. Shader-File as in the fx-Code? I dont know any way to assign a shader only to a region of a mesh, but maybe you can create your object out of many meshes and give each another shader.

2. Shaders on Screen are called Postprocessing-shaders as far as i know. GS offers alot of those already like Bloom.
to apply a shader on screen read the manual, there is an example.

3. i dont think so... but maybe.

4. i think yes, but i dont know how as im not a shader-programmer laugh


Regarding your answer on point number1 - shader files are indeed code written in .fx files ( since the 3ds game studio A8 uses DirectX 9 ). Do ypu know how to join many custom meshes to be joined together to make a complex object ?

Thanks,

Re: Some questions regarding shaders in 3D Game Studio [Re: Juggernaut] #399013
04/10/12 10:19
04/10/12 10:19

C
chris_oat
Unregistered
chris_oat
Unregistered
C



i have no experiance in joining meshes together but as i saw there are some expamples in the AUMS, like a car that gets its tires attached by script. that way the tires can have a different shader attached then the car mesh.
Ill try to find an example.

EDIT: Here is an example of one of the AUMs:

Code:
Q: I want to create a car that has its wheels attached at runtime. How can I do that?

A: Here's a fully functional example for a car that moves in a circle.

STRING* wheel_mdl = "wheel.mdl";

function front_left_wheel()
{
       VECTOR wheel_offset;
       set (my, PASSABLE);
       while (1)
       {
               vec_set(wheel_offset, vector(43, -20, -15));
               vec_rotate(wheel_offset, you.pan);
               vec_add(wheel_offset.x, you.x);
               vec_set(my.x, wheel_offset.x);
               my.pan = you.pan;
               my.roll = you.roll;
               wait (1);
       }
}

function front_right_wheel()
{
       VECTOR wheel_offset;
       set (my, PASSABLE);
       while (1)
       {
               vec_set(wheel_offset, vector(43, 20, -15));
               vec_rotate(wheel_offset, you.pan);
               vec_add(wheel_offset.x, you.x);
               vec_set(my.x, wheel_offset.x);
               my.pan = you.pan;
               my.roll = you.roll;
               wait (1);
       }
}


function back_left_wheel()
{
       VECTOR wheel_offset;
       set (my, PASSABLE);
       while (1)
       {
               vec_set(wheel_offset, vector(-32, -20, -15));
               vec_rotate(wheel_offset, you.pan);
               vec_add(wheel_offset.x, you.x);
               vec_set(my.x, wheel_offset.x);
               my.pan = you.pan;
               my.roll = you.roll;
               wait (1);
       }
}
 
function back_right_wheel()
{
       VECTOR wheel_offset;
       set (my, PASSABLE);
       while (1)
       {
               vec_set(wheel_offset, vector(-32, 20, -15));
               vec_rotate(wheel_offset, you.pan);
               vec_add(wheel_offset.x, you.x);
               vec_set(my.x, wheel_offset.x);
               my.pan = you.pan;
               my.roll = you.roll;

               wait (1);

       }

}

 

action car_body() // attach this action to your car body model
{
       my.ambient = -40;
       ent_create(wheel_mdl, my.x, front_left_wheel); // create the front left wheel model
       ent_create(wheel_mdl, my.x, front_right_wheel); // create the front right wheel model
       ent_create(wheel_mdl, my.x, back_left_wheel); // create the back left wheel model
       ent_create(wheel_mdl, my.x, back_right_wheel); // create the back right wheel model
       while (1)
       {
               // simple snippet, moves the car in a circle
               c_move (my, vector(5 * time_step, 0, 0), nullvector, IGNORE_PASSABLE | GLIDE);
               my.pan += 2 * time_step; // 2 sets the radius of the rotation circle              
               wait (1);
       )
}



Basically you can do it with all stuff like adding armor, weapons etc.

Edit2:
ther is also this function in GS:
ent_mtlset (ENTITY*, MATERIAL*, var skin);
there you can assign each skin a different Material. Maybe helpful too.

Last edited by chris_oat; 04/10/12 10:36.
Re: Some questions regarding shaders in 3D Game Studio [Re: ] #399017
04/10/12 11:08
04/10/12 11:08
Joined: Mar 2012
Posts: 43
J
Juggernaut Offline OP
Newbie
Juggernaut  Offline OP
Newbie
J

Joined: Mar 2012
Posts: 43
Hello Chris,

Thank you for giving such a detailed example and giving time to help me out.

I guess there is a lot to learn from the AUMs, which I will have to go through as a newbie.

Thank you again for your time and effort.

Thnaks,

Re: Some questions regarding shaders in 3D Game Studio [Re: Juggernaut] #399067
04/10/12 20:41
04/10/12 20:41
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI

Yes on all of them:

1. You have to do it in med. select the faces, and apply the skin that has the appropriate shader linked to it

2. Chris answered

3. Could be done a couple ways. make a quad the size you need of the screen and keep it lined up with the camera. You could also do screenspace testing in the shader to determine what portion of the screen you are.

4. Yes they can be passed. A quick read into the manual looking at material skill etc. will give you the info you need.

Re: Some questions regarding shaders in 3D Game Studio [Re: lostclimate] #399094
04/11/12 10:52
04/11/12 10:52
Joined: Mar 2012
Posts: 43
J
Juggernaut Offline OP
Newbie
Juggernaut  Offline OP
Newbie
J

Joined: Mar 2012
Posts: 43
Thank you lostclimate ....... you just filled in the missing parts and gave me hope ...... thank you once again. laugh


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