Render Monkey

Posted By: tompo

Render Monkey - 04/13/07 18:41

How to use exported .fx files from Render Monkey?
Because when I exported .fx file and include all .3ds models from this .fx file... nothing happened. Maybe is somewhere a tutorial?
Posted By: bstudio

Re: Render Monkey - 04/13/07 18:54

first of all the render monkey fx files won't work directly but have to be converted. second of all, fx files are used like this:

Code:

material shader_material
{
effect = "effect.fx";
}

action model_with_shader
{
my.material = shader_material;
}


just assign the action to the model and you're done
Posted By: tompo

Re: Render Monkey - 04/13/07 19:00

THX I know how to attach .fx to material, by thx anyway.
More importand thing... how to convert?!
Posted By: bstudio

Re: Render Monkey - 04/13/07 20:29

for example the world matrix has to be the one used by 3dgs, there is some stuff in the manual at the shaders department
Posted By: TheGameMaker

Re: Render Monkey - 04/15/07 16:06

I think there was a great tutorial on Ackenex unlimited...
(about using shaders in GS... canīt remerber if there was specificaly told about rendermonkey, but its a good start)
greetz tgm
Posted By: bstudio

Re: Render Monkey - 04/15/07 17:47

You mean the introduction to shader programming? Yes that is a great starting point for beginning shader programmers. Though converting rendermonkey shaders shouldn't be too tough
Posted By: TheGameMaker

Re: Render Monkey - 04/16/07 14:11

yeah... exact.. converting from Rendermonkey is as simple as possible(just have to set the globals...) but u need to have a little idea of what is gooing on inside the shader...(iīm not that a shader guy, but when i fianly understood how they work it was no problem converting some simple tests to GS...)
Posted By: tompo

Re: Render Monkey - 04/16/07 18:31

some tutorial maybe lol
Posted By: oliver2s

Re: Render Monkey - 04/16/07 20:09

If you use Rendermonkey .fx files, you have to rename the float4x4 variables into 3DGS names (like the MatWorldViewProj matrix).
Posted By: bstudio

Re: Render Monkey - 04/17/07 07:35

yep, nothing to it
Posted By: Machinery_Frank

Re: Render Monkey - 04/17/07 07:41

Quote:

If you use Rendermonkey .fx files, you have to rename the float4x4 variables into 3DGS names (like the MatWorldViewProj matrix).




Is there a list of such variables? How do I know which float4x4 becomes which variable? A little example would be very helpful.
Posted By: bstudio

Re: Render Monkey - 04/17/07 09:00

well all float4x4 are variables
Posted By: tompo

Re: Render Monkey - 04/17/07 10:17

Maybe liitle example? PLEASE
F.e. code from render monkey and next "fixed" one to use in 3dgs
Posted By: Machinery_Frank

Re: Render Monkey - 04/17/07 10:27

Quote:

well all float4x4 are variables




Ha ha, you are a joker, aren't you?

My question is: How do I know which 3dgs variable like "MatWorldViewProj" becomes which float4x4 variable in the shader.

I think the biggest problem with converting shaders is to create a working interface between your software (3dgs) and the shader code. So I would like to know more about the way how to create such an interface.

Maybe Excessus can help with that? He made such a good shader tutorial.
Posted By: Excessus

Re: Render Monkey - 04/17/07 10:43

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);
}
Posted By: Machinery_Frank

Re: Render Monkey - 04/17/07 13:08

Thanks Excessus. This is a very helpful answer. I even did not know that there is a shader variable list in the manual. I have to look for it.
Posted By: Uhrwerk

Re: Render Monkey - 04/17/07 13:35

That's some very usefull information, Excessus. Thank you! Maybe this could be worth an article in the wiki?
© 2023 lite-C Forums