Page 1 of 1

Shader additional options

PostPosted: Thu Aug 15, 2019 12:14 am
by Mark Bell
There are times when the Shader can provide the 'right' looking image that isn't easily produced in either the Object Viewer or Sunshader. Having some additional features would improve what images can be output:
1. In the Rendering Options add the ability to render the whole model in a selected colour. This would temporarily override any material or smart entity properties and simply render all entities in one colour similar to a clay render available in rendering software. This allows quick massing model studies without having to individually reassign colour properties just to create some images.

2. Add the ability to use a selected line type for the edge type display,

Re: Shader additional options

PostPosted: Thu Aug 15, 2019 12:48 am
by joshhuggins
Mark Bell wrote:1. In the Rendering Options add the ability to render the whole model in a selected colour. This would temporarily override any material or smart entity properties and simply render all entities in one colour similar to a clay render available in rendering software. This allows quick massing model studies without having to individually reassign colour properties just to create some images.

2. Add the ability to use a selected line type for the edge type display,
These both get my vote! :D

Re: Shader additional options

PostPosted: Thu Aug 15, 2019 3:56 pm
by Mark F. Madura
Mark Bell wrote:In the Rendering Options add the ability to render the whole model in a selected colour.

Hi Mark,

In the [o2cViewer] section of DCADWIN.ini, you can use the MatFixed keys to force a rendering property on all entities, regardless of their corresponding material settings.

So, you can force the rendered color of all entities to be 'Clay' by setting the MatFixed ClrDiff_Red, Green, and Blue keys as follows:

MatFixed ClrDiff_Red=188
MatFixed ClrDiff_Green=177
MatFixed ClrDiff_Blue=155

If you want to 'hide' all of the textures, set MatFixed Has Texture=FALSE.

If you want to mix the Clay color with all of the textures, set MatFixed Texture Colorize=TRUE.

If you want all surfaces to have the same texture, set MatFixed Texture Name=[path and name of bitmap] and set MatFixed Texture Scale=[size of pattern in decimal meters].

I often set MatFixed Render Backface=TRUE so I don't have to worry about polygons that are facing the wrong way or materials that are not set to render backface.

You can make everything transparent by setting MatFixed Opacity=50 where 1 is invisible and 100 is opaque.

Here's the complete list:
Leave the keys empty if you want to use the material property from the material definition.
Note: You do not need to restart DataCAD after making these changes to the ini file. These keys are read each time the model is generated.

MatFixed ClrDiff_Blue=
MatFixed ClrDiff_Green=
MatFixed ClrDiff_Red=
MatFixed ClrRefl_Blue=
MatFixed ClrRefl_Green=
MatFixed ClrRefl_Red=
MatFixed Has Texture=
MatFixed Texture Mask=
MatFixed Self-Illuminate=
MatFixed Texture Colorize=
MatFixed Render Backface=TRUE
MatFixed Texture Reflection=
MatFixed Specular Reflection=TRUE
MatFixed Highlight Size=
MatFixed Opacity=
MatFixed Reflection Ambient=
MatFixed Reflection Diffuse=
MatFixed Reflection Specular=
MatFixed Refraction=
MatFixed Smooth Edges=
MatFixed Texture Scale=
MatFixed Texture Name=

Re: Shader additional options

PostPosted: Thu Aug 15, 2019 7:04 pm
by Mark Bell
Hello Mark,

Thanks for the feedback. These have been applied and we're able to get some good results - cheers.

Re: Shader additional options

PostPosted: Thu Aug 15, 2019 10:15 pm
by joshhuggins
Cool. Could make a script to swap out "normal" versions of the file and a "clay" version before running the viewer and map it to a macro/toolbar buttons.