Mental Ray - Shaders


#881

zomboxy,

sorry, you were right in saying that the info discussed in this forum with regards to lume tools, physics, base and other shaders is greatly beneficial to us all. no feathers ruffled, just don’t see the point in not answering basic/ standard shader queries when the arise.

Peace to y’all

Phil b


#882

I a question dejour,
Could someone explain how to access the Dirtmap.dll shader in Mental Ray.
I placed the .dll and .mi files in the spropriate directories, I think :slight_smile:
and when I load the occulsion scenes I am informed the files are missing.
Cheers
Mike K


#883

Hi Guys ,

I’ll toss my vote in with bubba_989. If some kind soul could go through the steps on installing and using the dirt map thingy for us lower end max useres that would be great.

Thanks in advance.

  • S

#884

Below is a description and file


#885

well here goes an attempt on the description on the dirtmap

firstly unzip the dirtmap files

the dirtmap.mi goes in C:\3dsmax6\mentalray\include

the dirtmap.dll goes in C:\3dsmax6\mentalray\shaders

reboot your machine.

start max

should be ok

Create a plane

create a sphere centre to the plane and let the plane disect the sphere…

open the material editor

make sure you have a standard material with default settings

go to the mental ray connection rollout

click the padlock by the surface parameter

add the dirtmap here( dont change any settings)

apply the dirtmap to the sphere and the plane

go to the environments panel and make your background white
rendering menu/environment > color swatch

create a skylight with default settings

create a sunlight with default settings

hit render

you will see the dirtmap working

For a more detailed method of using the map i suggest reading the help.txt file that unzips with it

kind regards

nebille

I have attatched the max file with the above settings if you have trouble


#886

when I put those two files in those folders and start up Max (6) I get this error message:

“MI 0.0 warn 122001: standard startup file ray3rc not found
MSG 0.0 error: Shader declaration ‘Dirtmap’ has no apply type. This shader cannot be used in 3ds max until it has at least one apply type.”

Am I missing something?


#887

You could try moving the .mi file to the lib folder. I’ve had to play with location on a few shaders. Dunno why, but it worked.


#888

rochachew, (obvious nessy lover)

the dirt map originated from maya, or another piece of software. the dll that goes in the shader folder is correct but the .mi file that goes in the include folder needs an apply texture statement for the gui control ni max, this is what you should have in the dirtmap.mi file

MI declarations for Daniel Rind’s Dirtmap 1.2 Mental Ray shader

by Horvátth Szabolcs (szabolcs@impresszio.hu)

corrected for MAX by javier info@internarte.com

declare shader
color “Dirtmap”
(
color “BaseColor”, #: default 1.0 1.0 1.0
color “DirtColor”,
boolean “BentNormals”,
boolean “ProbeGeometry”, #: default 1
boolean “UseEnvironment”,
boolean “m_IllumInvis”, #: default 1
scalar “RaySpread”, #: default 88.0 min 0.0 softmax 90.0 max 180
integer “Samples”, #: default 16 min 0 softmax 128
scalar “NearClip”, #: default 0.1
scalar “FarClip”, #: default 10
scalar “FalloffGain”, #: default 1.0 min 0.0 softmax 1.0
vector “BasisVector”,
scalar “VectorBlend” #: min 0.0 max 1.0
)
version 1
apply texture

gui "gui_Dirtmap" {
	control "BaseColor" "color" ("value" 1 1 1)
	control "DirtColor" "color" ("value" 0 0 0)
	control "BentNormals" "boolean" ("uiName" "Bent Normals", "value" 0)
	control "ProbeGeometry" "boolean" ("uiName" "Probe Geometry","value" 1)
	control "UseEnvironment" "boolean" ("uiName" "Use Environment","value" 0)
	control "m_IllumInvis" "boolean" ("uiName" "Invisible to secondary illumination","value" 1)
	control "RaySpread" "scalar" ("uiName" "Ray Spread", "value" 88.0,"range" 0.0 180.0)
	control "Samples" "integer" ("value" 16,"range" 0 128)
	control "NearClip" "scalar" ("uiName" "Near Clip", "value" 0.1)
	control "FarClip" "scalar" ("uiName" "Far Clip", "value" 10.0)
	control "FalloffGain" "scalar" ("uiName" "Falloff Gain", "value" 1.0,"range" 0.0 1.0)			control "VectorBlend" "scalar" ("uiName" "Vector Blend", "value" 0.0,"range" 0.0 1.0)	
	

}

end declare


#889

rochachew, (obvious nessy lover)

the dirt map originated from maya, or another piece of software. the dll that goes in the shader folder is correct but the .mi file that goes in the include folder needs an apply texture statement for the gui control ni max, this is what you should have in the dirtmap.mi file

MI declarations for Daniel Rind’s Dirtmap 1.2 Mental Ray shader

by Horvátth Szabolcs (szabolcs@impresszio.hu)

corrected for MAX by javier info@internarte.com

declare shader
color “Dirtmap”
(
color “BaseColor”, #: default 1.0 1.0 1.0
color “DirtColor”,
boolean “BentNormals”,
boolean “ProbeGeometry”, #: default 1
boolean “UseEnvironment”,
boolean “m_IllumInvis”, #: default 1
scalar “RaySpread”, #: default 88.0 min 0.0 softmax 90.0 max 180
integer “Samples”, #: default 16 min 0 softmax 128
scalar “NearClip”, #: default 0.1
scalar “FarClip”, #: default 10
scalar “FalloffGain”, #: default 1.0 min 0.0 softmax 1.0
vector “BasisVector”,
scalar “VectorBlend” #: min 0.0 max 1.0
)
version 1
apply texture

gui "gui_Dirtmap" {
	control "BaseColor" "color" ("value" 1 1 1)
	control "DirtColor" "color" ("value" 0 0 0)
	control "BentNormals" "boolean" ("uiName" "Bent Normals", "value" 0)
	control "ProbeGeometry" "boolean" ("uiName" "Probe Geometry","value" 1)
	control "UseEnvironment" "boolean" ("uiName" "Use Environment","value" 0)
	control "m_IllumInvis" "boolean" ("uiName" "Invisible to secondary illumination","value" 1)
	control "RaySpread" "scalar" ("uiName" "Ray Spread", "value" 88.0,"range" 0.0 180.0)
	control "Samples" "integer" ("value" 16,"range" 0 128)
	control "NearClip" "scalar" ("uiName" "Near Clip", "value" 0.1)
	control "FarClip" "scalar" ("uiName" "Far Clip", "value" 10.0)
	control "FalloffGain" "scalar" ("uiName" "Falloff Gain", "value" 1.0,"range" 0.0 1.0)			control "VectorBlend" "scalar" ("uiName" "Vector Blend", "value" 0.0,"range" 0.0 1.0)	
	

}

end declare

okeydokey dude

Phil b


#890

I got it working!

Thanks for the help guys. Works and looks sweet.

  • S

Rockachew - (obvious nessy lover) ?

That’s a pokemon thing right? :wink:


#891

no, it’s an old british cartoon, based on the lockness monster, rockachew is part of the tune. I wont sing it though, i’ll get told off for waisting forum space !!!

Phil b


#892

Thanks for the help with the MI file, it did the trick!
Cheers
Mike K


#893

hello all,

I know the glare shader has been discussed in brief before, but has anyone got their head around the object specific yet.
It seemed before that the shader didn’t work with quality values of less than three, and no matter how much i fiddle with the settings, setting object g-buffers, effects channels to correspond to the shader object specific settings, i just can’t get it to shade a specific object. i’m trying to create a light bulb effect glow with this, and when using a streak image with just the bulb unhidden, it works fine but obviously with the rest of the scene is visible i want the glare to be specifically for the bulb. can anyone help ?

Phil b


#894

How about using a lightmap like feature like Maya uses to render to texture? Is there a way to do this?


#895

Hi All. This famous thread helped me a lot in understanding mental ray rules… anyway, some things stay quite “obscure” for me…
When opening the lume help file, switching to glare, they are talking of a feature which seems very usefull… Illumination shader. it seems it can be used in conjunction whith glare shader, to improve contrasts etc…
The problem is : how to use the illumination shader ?
glare, i put it in camera output slot, but “illumination”, where can i put it to see its effects ?

Thanxx

Bye All


#896

Place the illumination shader into the light shader map of your light source (under the metal ray light shader roll out of your light source).

Now with that said, I personally haven’t had any luck with this. It turns my light source red. I suppose an adjustment lume shader in the camera output shader slot may correct this, but it would adjust the whole scene.

Which leads back to philipbruton’s problem with the glare shader. These shaders are looking for a “tag” on your scene objects. I personally have had no luck in finding info on how to make the “tags” work.

anyone else?


#897

Not to sure if this has anything to do with it

I copied this text from

http://vbus.rulez.pl/index.php?la=en&pg=431

Hmmm havent read it fully but it explains tags for games and objects…

May be someone with more brains can work it…

  • PLACING OBJECTS *

to put an object into game world you have to use M1 tag.

example:
M1 596,1589,0,90,1,1,1,“scene\st_1.3ds”

line has to start with M1 tag,
1st, 2nd and 3rd parameters are position of the object
4th is rotation around vertical axis, in degrees.
5th,6th,7th are scale factors.
8th is name of file which contains the object.
(in example - ‘st_1.3ds’ is file with bus stop)
you can use 3DS files (3d studio, 3ds max and many others).
textures should be put in the same folder that contains 3DS file.

you can also put flat rectangular object using P2 and B2 tags.

example:
P2 787,1734,0,22,4,7,“scene\drzewo.bmp”

parameters 1-3 are position ,
4th parameter is rotation about vertical axis,
5th and 6th are dimensions of rectangle.
last is name of file with picture to be displayed.
B2 puts opaque rectangle, P2 puts fragmentary transparent one. (transparency is set by topleft pixel)

  • ROADWAYS *

to put a roadways object file you have to use U1 tag.

U1 0,0,0,0,1,1,1,“scene\ulice.3ds”

Parameters are same with M1 tag parameters.
There should be only one U1 tag in *.ms1 file.
NOTES:
1st - shape of the roadways has to be FLAT.
2nd - game is scaled in meters, so one unit in modeler equals one meter in the game
3rd - DO NOT put any other objects in this file besides roadways. Object like builings and busstops chould be put in a *.ms1 file.

BUS STARTING POSITION

You can set bus start position with A1 tag.

example:
A1 10,200,90

1st and 2nd parameters are position, 3rd is rotation around vertical axis.

  • SETTING UP THE TIMETABLE *
    most of information about map and route is stored in *.ms1 files in game main folder. first part of the file contains information about object like buildings, trees etc. then goes part that sets up positions od bus stops. these lines begin with ‘ST’ tag and look like this:

ST 2,798,1748,0,0,“os. Swoboda 02”

first parameter is unique number of this bus stop.
2nd,3rd,4th is position of the bus stop.
5th is rotation about vertical axis.
6th parameter is name of the stop.

ATTN :4th and 5th parameters are ignored in current version
ATTN2:ST tag DOES NOT put visible object into game world , you have to put in other way (i.e. with M1 tag)

then you have to define a timetable.
timetable begins with RB tag, with parameter - start of simutation time.

every stop in the timetable starts with RS tag
1st parameter is number of busstop (previously defined with ST tag) 2nd is arrival time.
3rd is number of passangers who want to get out at this stop (’-1’ empties the bus)
4th if number of passangers waiting to step into the bus.

ATTN the programm does not use equal numbers from 3rd and 4th parameters but numbers from range 50%-150% of them.
timetable ends with RE tag

Ostatnia aktualizacja strony 16.10.2003


#898

hello,

i did post some info on the mr tag feature on this thread, i don’t know if anyone looked at it but it’s all french to me !

phil b


#899

I asked the question on the discreet forum and some one replied the below…

Object Labels are tags, their function in MR is somewhat like max g-bufferIDs. The problem is how do you access this tag number, since there is no gui for this or maxScript interface. Yet, there is a way, which I have yet to test, you can export the scene to a .MI file and upon searching for “tag” you’ll find that every Mesh has its tag clearly listed. Look in the MR manual, 1.28 Output Shaders.


#900

What up everyone …

I haven’t been in here for awhile.

I just graduted and finished my demo reel :::

here is the Link :thread