3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1]

Author Topic: it is possible to apply Shaders on a rigidbody  (Read 273 times)

« on: May 06, 2014, 08:31:00 AM »
it is possible to apply shaders to a rigidbody all you need is the shader library which I'm including in the attachments.
all you need to do is just copy the script settings that are in it and load up the scripts.
« Last Edit: May 06, 2014, 12:39:21 PM by dogtorque »
I be trippin!
« Reply #1 on: May 09, 2014, 06:13:37 AM »
Quote
all you need to do is just copy the script settings that are in it and load up the scripts.

load up the scripts where... into what...

how do you tell the rb to use the shader in the script...


--Mike
« Reply #2 on: May 10, 2014, 02:25:33 PM »
Quote
all you need to do is just copy the script settings that are in it and load up the scripts.

load up the scripts where... into what...

how do you tell the rb to use the shader in the script...


--Mike
oh yeah sorry forgot to tell you but in order to apply shaders to a rigidbody you must first get the script object 2 of them...one for the model shader selector script and the other is for the skinmesh shader itself and since the rigidbodys have a skinmesh file in them which we all know it's the rigidbody_mesh file it applys the shader to that.
heres the stuff the shaders the scripts can apply to the rigidbodys that I know of so far.
and thank you for reminding me mike I appreciate it.
_________________________________________________________________________________________________________________________________
Script_Shader_NormalMap_DL_SubSurf_Color_ThicknessMap
Script_Shader_NormalMap_DL_SubSurf_Texture_ThicknessMap
Script_Shader_NormalMap_CP_DL
Script_Shader_NormalMap_CP_DL_AlphaMap
Script_Shader_NormalMap_CP_DL_SpecMap
Script_Shader_Emissive
_________________________________________________________________________________________________________________________________
and using any of these scripts that also use the normalmap it applys that to the rigidbody_mesh
but the since the rigidbody does not have a reflection settings like the skinmesh you can put reflections into it unless you know a shader that can fix that.


the scripts obs files are in the included zip file above.
I think you should know how to do it from here. lol
« Last Edit: May 10, 2014, 02:36:32 PM by dogtorque »
I be trippin!

Ed

« Reply #3 on: May 10, 2014, 07:36:48 PM »
It Works!

Cool find, dogtorque!

This opens up some interesting possibilities to use less SkinMeshes (less DrawCalls, maybe).

Thanks for this and also thanks to GeneTransfer for the use of his Script Shaders!


Edit:
The .3dr file i posted below requires Genetransfer's Shader Pack with accompanying 'fxTextures' folder and textures.
If you don't have the Shader Pack then:

In your 3DRad_res folder create a folder and name it 'fxTextures'. Create another folder inside this one and name it 'default'.
Inside the 'default' folder you'll need two textures named 'default_diffuse_map.dds' and 'default_normal_map.dds'.
If you don't already have these textures you'll have to improvise. Just make sure one is a normal map and the other a
diffuse map.
« Last Edit: May 11, 2014, 11:34:18 PM by Ed »
« Reply #4 on: May 10, 2014, 08:45:44 PM »
a lil caution here...  rbs are physics enabled volumes, and should be simple constructions, not the complex forms that skinmeshes are intended to be...

if you're making shapes that are more than simple cubic forms or spheres, then you may be causing the physics simulation a lot more work than the it would otherwise need to do with the additional skinmesh...


--Mike

 
« Reply #5 on: May 10, 2014, 08:53:32 PM »
a lil caution here...  rbs are physics enabled volumes, and should be simple constructions, not the complex forms that skinmeshes are intended to be...

if you're making shapes that are more than simple cubic forms or spheres, then you may be causing the physics simulation a lot more work than the it would otherwise need to do with the additional skinmesh...


--Mike
yeah but this can be handy when your using the imposter object with the rigidbodys.
I be trippin!
« Reply #6 on: May 10, 2014, 11:06:02 PM »
Quote
yeah but this can be handy when your using the imposter object with the rigidbodys.

how...

--Mike
« Reply #7 on: May 11, 2014, 03:07:51 PM »
Quote
yeah but this can be handy when your using the imposter object with the rigidbodys.

how...

--Mike
I noticed that every time you use the imposters object on a rigidbody and the skinmesh following that rigidbody the skinmesh's copy's don't follow the other copy's of the rigidbody.
I be trippin!
« Reply #8 on: May 12, 2014, 07:52:46 AM »
again... most people misuse (or over use) imposter rigidbodies in their scenes... 

fact: you will only be colliding with one object at any given time (excluding the terrain)...

if you accept the above, the logical extrapolation is that you only need one rigidbody in your scene... no matter how many tree trunks, boxes, etc  that you might potentially walk into and bump... for each of those types of objects...

a lil script logic can be used to position the rb to the closest object (usually a skinmesh or skinmesh imposter) to the player...

again, i maintain that rbs should be untextured and hidden...  a simple collision volume only... and, not used as visuals in a project....

but hey, whatever gets the job done...

--Mike
Pages: [1]