shaders/materials in vray

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

shaders/materials in vray // New Users

1  |  

Post by grymmjack // Aug 7, 2008, 5:53pm

grymmjack
Total Posts: 87
pic
can i use regular shaders, dx9 materials, and vray materials/shaders at same time? would doing this be a bad idea? or if i use vray do i have to use exclusively vray stuff?

Post by kena // Aug 7, 2008, 5:57pm

kena
Total Posts: 2321
pic
Many of the v-ray shaders do not work well with real-time view. Most of the real-time shaders will render v-ray, but there may be some slight differences.

Post by Jack Edwards // Aug 8, 2008, 1:48am

Jack Edwards
Total Posts: 4062
pic
You can set separate materials for each render engine, but the default settings try to keep the materials synced by finding a best match. You'll get much better results setting the materials as you want them manually for the render engine that you are planning to use.

Post by grymmjack // Aug 8, 2008, 2:43am

grymmjack
Total Posts: 87
pic
thanks guys.


i noticed that a few of the shaders aren't present in vray - granite is one - i'm just curious why this is. i've been watching some shader videos to better grasp how to manipulate them, and was bummed to see vray doesn't have a few of the ones featured in the videos.


i guess i could work around it with my own texture/bump map anyway, but the shaders are pretty sweet. the granite and clouds ones especially.

Post by TomG // Aug 8, 2008, 3:41am

TomG
Total Posts: 3397
Shaders are pieces of code that calculate how a surface will look. As such they call upon routines and libraries inside the shader engine they are built for. This makes them highly dependent on the render engine you are using, as not all render engines will have the same routines, with the same names, with the same input parameters, etc.


The granite color shader uses a bunch of math routines to work out a colored pattern, and those routines are called from the library of routines for Lightworks. V-Ray won't have those same routines, so a whole new and different shader to do granite would need to be written.


So that is why shaders are render engine specific :) Now, you can mix and match, and trueSpace will do its best to work with it. For example, if you use something like Granite, tS will actually bake the result from Lightworks into a texture (an image). Then on the workspace side it will display the object painted with this texture, and it will render in V-Ray using that texture.


Note that texture mapping is when an image is used to color the surface, with one point on the surface taking its color from one point in the 2D image (which points on the surface map to which points in teh image is determined by the UV mapping). Applying a texture to a surface in this way is universal and every render engine always has some way of doing this, so texture mapping for color can easily travel from one render engine to another (including being imported from another application).


By baking the procedural color shader result into a texture, it allows the results of that procedural color shader to be passed "second hand" if you like from one render engine to another - but it may not be entirely accurate, or the same as seen when rendered direct under the other render engine the procedural shader was built for. You will get an "approximation" and it may vary in accuracy.


This cannot be done with reflectance shaders by the way, which calculate how light is handled on the surface to set specular highlights, reflections, diffuse brightness, transmission etc. This is ALWAYS done by mathematical routines called from the render engine, so is render engine specific - you can't bake the results into a texture map unlike procedural color (or procedural bump, etc).


tS will try to pass the parameters across to a shader that approximates the one you are using, so a Lightworks glass shader will pass the values over to the V-Ray glass shader (but the actual shader that handles those values will be different code). The approximation may or may not be good. Sometimes there is no equivalent (eg the Fresnel shaders in V-Ray have no Lightworks equivalent, the Car Paint shader in Lightworks has no V-Ray equivalent).



In the end it is best to choose the render engine you will use for a project at the beginning of the project and stick with it, creating and using the shaders specifically for that engine. This will give the best and most accurate results and avoid conversions and approximations.


HTH!

Tom


PS - check out ShaderLab which was a shader building system, you can look inside and see the shader code if you want to see what a shader looks like from the inside :)


Download the install here:

http://www.primitiveitch.com/pub/


Some extra shaders of mine here (most of the free shaders have their code open - the ones you can purchase have the code locked so you can't view it though, to avoid them being copied):

http://www.tmgcgart.com/ShaderLab/index.htm

Post by grymmjack // Aug 9, 2008, 4:26pm

grymmjack
Total Posts: 87
pic
Shaders are pieces of code that calculate how a surface will look. As such they call upon routines and libraries inside the shader engine they are built for. This makes them highly dependent on the render engine you are using, as not all render engines will have the same routines, with the same names, with the same input parameters, etc.


The granite color shader uses a bunch of math routines to work out a colored pattern, and those routines are called from the library of routines for Lightworks. V-Ray won't have those same routines, so a whole new and different shader to do granite would need to be written.


So that is why shaders are render engine specific :) Now, you can mix and match, and trueSpace will do its best to work with it. For example, if you use something like Granite, tS will actually bake the result from Lightworks into a texture (an image). Then on the workspace side it will display the object painted with this texture, and it will render in V-Ray using that texture.


Note that texture mapping is when an image is used to color the surface, with one point on the surface taking its color from one point in the 2D image (which points on the surface map to which points in teh image is determined by the UV mapping). Applying a texture to a surface in this way is universal and every render engine always has some way of doing this, so texture mapping for color can easily travel from one render engine to another (including being imported from another application).


By baking the procedural color shader result into a texture, it allows the results of that procedural color shader to be passed "second hand" if you like from one render engine to another - but it may not be entirely accurate, or the same as seen when rendered direct under the other render engine the procedural shader was built for. You will get an "approximation" and it may vary in accuracy.


This cannot be done with reflectance shaders by the way, which calculate how light is handled on the surface to set specular highlights, reflections, diffuse brightness, transmission etc. This is ALWAYS done by mathematical routines called from the render engine, so is render engine specific - you can't bake the results into a texture map unlike procedural color (or procedural bump, etc).


tS will try to pass the parameters across to a shader that approximates the one you are using, so a Lightworks glass shader will pass the values over to the V-Ray glass shader (but the actual shader that handles those values will be different code). The approximation may or may not be good. Sometimes there is no equivalent (eg the Fresnel shaders in V-Ray have no Lightworks equivalent, the Car Paint shader in Lightworks has no V-Ray equivalent).



In the end it is best to choose the render engine you will use for a project at the beginning of the project and stick with it, creating and using the shaders specifically for that engine. This will give the best and most accurate results and avoid conversions and approximations.


HTH!

Tom


PS - check out ShaderLab which was a shader building system, you can look inside and see the shader code if you want to see what a shader looks like from the inside :)


Download the install here:

http://www.primitiveitch.com/pub/


Some extra shaders of mine here (most of the free shaders have their code open - the ones you can purchase have the code locked so you can't view it though, to avoid them being copied):

http://www.tmgcgart.com/ShaderLab/index.htm


awesomely informative and helpful reply tom.


this is the kind of info i was after. it makes sense too.


so now all i have to do is come up with some way to test all of the different shaders and material combinations and store them as images for reference.


the truespace manuals are HUGE, wow. lot of reading :)


thanks.

Post by grymmjack // Aug 9, 2008, 4:31pm

grymmjack
Total Posts: 87
pic
tom shaderlab is sick! wow, the resources are endless around here.


so truespace can integrate shaderlab? like into the program or something?

Post by brotherx // Aug 11, 2008, 2:47am

brotherx
Total Posts: 538
pic
Isn't it a plugin? not really tried it.

Post by TomG // Aug 11, 2008, 5:41am

TomG
Total Posts: 3397
ShaderLab is a Model side shader in effect. Once installed, it will allow you to load ShaderLab as a shader in the Model side material libraries (so you'll see Glass, Metal, Phong etc, then ShaderLab - same under color, bump, etc).


You can set ShaderLab to be used in any combination of material channels (color, transparency, bump or reflectance). You then open the settings for that shader, and you get a ShaderLab panel that lets you choose from the shader lab shaders (so in other words what you load into the ME is like a wrapper, then you load the chosen shader into that using the shaderlab interface - simbiont / darktree works the same way, you get one "shader" visible in the tS selection of shaders, but once loaded you can then pick from a range of different shaders that go in there).


If the shader is not a protected binary file, you can then also open its code in Shaderlab and edit it, and also edit the interface that gives the user the chance to modify the settings for the shader.


The help files for shaderlab are good at going through all this :)


All shaderlab shaders only work with Lightworks, and can only be accessed using the Model side Material Editor.


HTH!

Tom

Post by grymmjack // Aug 11, 2008, 3:04pm

grymmjack
Total Posts: 87
pic
thanks tom. :)
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2021. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn