Jump to content

Help me on Materials for cars


omid3098
 Share

Recommended Posts

well we have some cars here and the primary material for their body is Diffuse+Normal+Specular+ some Gloss changes..

however it's not look like carpaint shader, but we are ok with that as we can't do anything else!

our biggest problem is glasses.

as far as I tested about this, we have 2 kind of transparency into engine. one of them uses only 0-1 in alpha channel of diffuse textures (mesh_diffuse_blabla_alphatest)in this case there is no problems during rendering or casting shadows or anything else.. but as this type is only for 0-1, so it should not use for glass like materials.

another kind of transparency is to use blend=alpha without using mesh_diffuse_blabla_alphatest in shader.

but this kind of transparency sucks when you want to use is as something like glass. it won't render terrain, some of models, shadows... (or maybe I can not use it correct)

this:

texture0="abstract::glasstest.dds"
clamp0=0,0,0
texture1="abstract::glasstest_nrm.dds"
clamp1=0,0,0
blend=alpha
depthmask=1
depthtest=1
overlay=0
zsort=0
cullface=0
castshadows=1
specular=2.50000000
bumpscale=0.300000012
gloss=0.250000000
shader="abstract::mesh_diffuse_bumpmap.vert","abstract::mesh_diffuse_bumpmap_specular_alphatest.frag"
shadowshader="abstract::mesh_shadow.vert","abstract::mesh_shadow.frag"

looks like this (only 0,1):

 

01.jpg

 

and this:

texture0="abstract::glasstest.dds"
clamp0=0,0,0
texture1="abstract::glasstest_nrm.dds"
clamp1=0,0,0
blend=1
depthmask=1
depthtest=1
overlay=0
zsort=0
cullface=0
castshadows=1
specular=2.50000000
bumpscale=0.300000012
gloss=0.250000000
shader="abstract::mesh_diffuse_bumpmap.vert","abstract::mesh_diffuse_bumpmap_specular_alphatest.frag"
shadowshader="abstract::mesh_shadow.vert","abstract::mesh_shadow.frag"

looks like this:

 

02.jpg

 

(but WHY?? :blink: )

This is my diffuse texture

and

This is my normal texture

and I can not use these for glasslike models.

but as I can see emitters are using transparent dust, I'm looking for something like that in normal shaders to use them as car glass shader which needs cullface for car inside too..

 

and alphatest results on car, looks like this:

 

206.jpg

 

and I'm too tired to make blend=alpha again! but it was worse than it's 2d plane!

finally any kind of tips or suggestions to improve car shaders would be helpfull here.

Omid Saadat

OD Arts Blog

 

AMD Phenom II X4 940 - Geforce 8800GTS - 4GB RAM - XP x86

AMD 6000+ - Geforce 9800 GT - 2GB RAM - XP x86 (Home pc)

Intel Core i7 - Geforce 310M - 4GB Ram - Win7 x64 (Laptop)

Link to comment
Share on other sites

thank you Lumoja,

2 more questions please:

- should we do this only in code? or is there any easier way to do this for someone like Game designer? as we tested we should do this with "loadmodel" command and it's hard for game designer to do this.

- should we detach glasses to separate GMF files or we can move a hierarchy of a model into foreground world?

Omid Saadat

OD Arts Blog

 

AMD Phenom II X4 940 - Geforce 8800GTS - 4GB RAM - XP x86

AMD 6000+ - Geforce 9800 GT - 2GB RAM - XP x86 (Home pc)

Intel Core i7 - Geforce 310M - 4GB Ram - Win7 x64 (Laptop)

Link to comment
Share on other sites

  • 1 month later...

I also have the same problem, I can not get transparency with specular.

 

Also how to run the refraction shader with the framework ?

 

And again, why there is a *0.5 in the shininess mesh.frag reducing by half the intensity of the specular

 

shininess=clamp(shininess,0,1)*0.5;

 

Let us choose the intensity of specular through a variable

 

 

 

 

Nicolas

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...