|
Re: Render Monkey
[Re: Machinery_Frank]
#123723
04/17/07 10:43
04/17/07 10:43
|
Joined: Jan 2004
Posts: 2,013 The Netherlands
Excessus
Expert
|
Expert
Joined: Jan 2004
Posts: 2,013
The Netherlands
|
There is a list of shader variables in the manual. These are the variables that the engine can send to the shader. If you want to convert a shader, you should just rename the variables to the ones in that list. Usually this is very straightforward. For example, you could see a variable MWVP or world_view_proj, and you'd change that to the 3dgs name: matWorldViewProj. If you've got a little shader knowledge you can also guess the right variable from the way it is used in the shader.
It's not really possible to create a general list for conversion, because every shader (for a different engine/tool) will use different names for their variables. I don't know rendermonkey, but if it uses a single variable naming sheme, you could create such a list or even automate it.
I'd say just give it a try and when you get stuck, ask for help. Generally I rather help someone who has given it a try for themselves, than just doing all the work for them..
EDIT: one more hint for converting: generally, you can recognize a variable that has to be changed by the fact that it is not assigned a value: float4x4 mwvp; // This is not initialized, so it must be set by the engine -> change it to matWorldViewProj. float4 baseColor = {0.3f, 0.7f, 0.2f, 1.0f}; // A value is assigned so this variable doesn't have to be changed.
Sometimes, a variable is not assigned where it is defined, but where it is used: int numTaps;
float4 mypixelshader(inTexcoord : TEXCOORD0) {numTaps = 4; // Initialized here, this is clearly not a variable that is set by the engine. blur(numTaps, inTexcoord); }
Last edited by Excessus; 04/17/07 10:49.
|
|
|
Re: Render Monkey
[Re: Machinery_Frank]
#123725
04/17/07 13:35
04/17/07 13:35
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
That's some very usefull information, Excessus. Thank you! Maybe this could be worth an article in the wiki?
Always learn from history, to be sure you make the same mistakes again...
|
|
|
|