Jump to content

"Chrome" Material


subabrain

Recommended Posts

Hello together,


i have a question to you again :P


So now i try to make a "chrome" effect material on a shape in torque 3d.

Ive read some things but i dont get the key to work. So i have to use shaders but how can i do that - there is no good tutorial about that.


Would be nice if you could help me :)


Thanks a lot!


Greetings

Robert

Link to comment
Share on other sites

Two options:

1: Wait for 4.0 with PBR which will more accurately simulate material effects by default. -Takes long and is difficult.

2. Use a cubemap for reflections, this will simulate something being metallic and use lots of specular. -This is fast and easy.


Also remember that to use cubemap reflections you need an alpha channel in the diffuse texture, that will determine how reflective somehing is. I don't know if more transparency made it more reflective or less reflective, but you can just try it out, it was a weird system, but don't invest too much into it, since I think it will get replaced relatively soon or at least it should.

Link to comment
Share on other sites

Hello Duion,


Thanks a lot! I think ill try it with the cubemap - but theres one strange thing.

If i try to modify the cubemap i cant select the cubemap - its not visible to see the cubemaps - but only with the precompiled version its shown - why that?


I dont know what to do - maybe you can help me?


Thanks!


Greetz

Robert

Link to comment
Share on other sites

Maybe you broke it, you would have to document the exact steps you did to find out what went wrong.

The cubemap editor is known to be a bit complicated.

Try just adding the default skybox cubemap to a material to see if it works, without messing with cubemaps at all. In the material settings you can just apply an existing cubemap for reflections, just pick one there, do not edit them.

Link to comment
Share on other sites

The dev branch have a broken GUI for the cubemap.


You can still use it with TorqueScript perfectly.


1) define a material, 2) define a cubemap.

 

singleton Material( DesertSkyMat )
{
   cubemap = DesertSkyCubemap;
   materialTag0 = "Skies";
};
 
singleton CubemapData( DesertSkyCubemap )
{
   cubeFace[0] = "./cubemap/skybox_1";
   cubeFace[1] = "./cubemap/skybox_2";
   cubeFace[2] = "./cubemap/skybox_3";
   cubeFace[3] = "./cubemap/skybox_4";
   cubeFace[4] = "./cubemap/skybox_5";
   cubeFace[5] = "./cubemap/skybox_6";
};
Edited by Johxz
Link to comment
Share on other sites

hi there,


ok i think there are more bugs in the gui - f.e. to delete some elements in the scene, to delete it with the options menu (right click) isnt working ... but the good answer is that it works good with reflection :)

 

singleton CubemapData( DesertSkyCubemap )
{
   cubeFace[0] = "./art/skies/Desert_Sky/cubemap/skybox_1.png";
   cubeFace[1] = "./art/skies/Desert_Sky/cubemap/skybox_2.png";
   cubeFace[2] = "./art/skies/Desert_Sky/cubemap/skybox_3.png";
   cubeFace[3] = "./art/skies/Desert_Sky/cubemap/skybox_4.png";
   cubeFace[4] = "./art/skies/Desert_Sky/cubemap/skybox_5.png";
   cubeFace[5] = "./art/skies/Desert_Sky/cubemap/skybox_6.png";
};

 

...


i did this - thanks a lot!


Greetz

Robert

Link to comment
Share on other sites

An additional tip, the default skybox may not fit your scene for reflections on your objects, but what you can do is make a generic cubemap without much detail, that way it still looks like metallic reflections, but you no longer notice that much that the cubemap does not fit the environment.

Link to comment
Share on other sites

It should be pointed out that if you are using the development branch i added support for dds cubemap files

 

singleton CubemapData( MyCubemap )
{
   cubeMap = "path/to/my/cubemap.dds";
};

 

I totally forgot to post about this before, i can post further instructions if anyone is having trouble creating the cubemap file.

Link to comment
Share on other sites

I had problems using dds for skyboxes, since there are compression artifacts and they become very obvious if they cover the whole sky and even if it is just one pixel it still ruins all.

Skyboxes often have a very smooth gradient and dds formats somehow cannot render this properly.

Does anyone know which compression to use to avoid those problems?

Link to comment
Share on other sites

If bc3 (dxt5) still has artefacts just don't use compression (use a regular uncompressed RGBA8 format), i have also added in floating point support for dds formats so you can use hdr images for the skybox cubemap too. Make sure whatever tool you use is not generating mipmaps.

Link to comment
Share on other sites

Is there then still a benefit in using dds compared to just using pngs?

 

apart from floating point support, no not really, just neater having a one liner in the material file and one file per sky. Going a bit off topic now, there is also support in dev branch for BC5 (aka 3Dc or ati2n) normal maps. As you can see i am not very good at documenting stuff :D

Link to comment
Share on other sites

Oh I misread that, yes having 1 files may actually be a benefit, but I have yet to see an example how such file will look like and about floating point I have no idea what it does at all.

 

When i get chance over the weekend i'll start a new thread (i have hijacked this one enough :D ) and post a few examples and explain it all properly.

Link to comment
Share on other sites

Oh I misread that, yes having 1 files may actually be a benefit, but I have yet to see an example how such file will look like and about floating point I have no idea what it does at all.

 

not problem using dds, look pretty good as usual.

http://forums.torque3d.org/viewtopic.php?f=17&t=214&p=9196#p9196

That has not a gradient, try an mostly empty sky with a very fine gradient, that is where the compression often fails, if it is all fizzy, then you do not notice the artifacts. Which format did you use?

Link to comment
Share on other sites

If compression is causing problems stop using compression after all this is why in general we stopped using jpegs, and DDS files come with uncompressed options. Compression is only one of the handful of different advantages you get from using DDS it will still likely be a net gain using uncompressed DDS over PNGs.


I suspect that given the interest in reflections with a chrome effect then quality probably trumps performance in this particular case, its been a while since I read about DDS skymap formats, but i seem to recall there being a number of benefits to using them anyway. I'll see if I cant refind the page... I probably bookmarked it :)

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.

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.

×
×
  • Create New...