1 registered members (AndrewAMD),
1,320
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Some questions regarding shaders in 3D Game Studio
[Re: Juggernaut]
#399009
04/10/12 09:16
04/10/12 09:16
|
chris_oat
Unregistered
|
chris_oat
Unregistered
|
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
|
|
|
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
Juggernaut
OP
Newbie
|
OP
Newbie
Joined: Mar 2012
Posts: 43
|
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 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
|
chris_oat
Unregistered
|
chris_oat
Unregistered
|
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:
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.
|
|
|
|