Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AemStones, AndrewAMD, gamers, Kingware), 1,679 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Render Monkey [Re: oliver2s] #123719
04/17/07 07:41
04/17/07 07:41
Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
Machinery_Frank Offline
Senior Expert
Machinery_Frank  Offline
Senior Expert

Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
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.


Models, Textures and Games from Dexsoft
Re: Render Monkey [Re: Machinery_Frank] #123720
04/17/07 09:00
04/17/07 09:00
Joined: Aug 2006
Posts: 652
Netherlands
bstudio Offline
User
bstudio  Offline
User

Joined: Aug 2006
Posts: 652
Netherlands
well all float4x4 are variables


BASIC programmers never die, they GOSUB and don't RETURN.
Re: Render Monkey [Re: bstudio] #123721
04/17/07 10:17
04/17/07 10:17
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline OP
User
tompo  Offline OP
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
Maybe liitle example? PLEASE
F.e. code from render monkey and next "fixed" one to use in 3dgs


Never say never.
Re: Render Monkey [Re: bstudio] #123722
04/17/07 10:27
04/17/07 10:27
Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
Machinery_Frank Offline
Senior Expert
Machinery_Frank  Offline
Senior Expert

Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
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.


Models, Textures and Games from Dexsoft
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
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

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: Excessus] #123724
04/17/07 13:08
04/17/07 13:08
Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
Machinery_Frank Offline
Senior Expert
Machinery_Frank  Offline
Senior Expert

Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
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.


Models, Textures and Games from Dexsoft
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 Offline
Expert
Uhrwerk  Offline
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...
Page 2 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1