PDA

View Full Version : About 'native functions' for Level2 MetaSL



katsu
January 18th, 2008, 13:34
Dear RS users,

#I'm sorry for my poor English.

I use RealityServer2.1 Developer Edition.
According to the documentation "MetaSL_spec.pdf, p-7",
we are able to implement specific functions using C++ language,
and these functions are called 'native functions'.
Also, these seem to be good for compatibility between Level2 and Level3.

So, I would like to try 'native functions' implementation.
The following are my expectation:

----------------------------------------------------
1. create .cpp file (named nf_test.cpp) which includes "metasl.h".
2. In nf_test.cpp, code a function like a following:

Scalar io_test(String filename) {
FILE* fp = fopen(filename.c_str(), "rb");
float value;
fread(&value, sizeof(float), 1, fp);
fclose(fp);
return value;
}

3. compile and link nf_test.cpp, and export .dll file like a mental ray shader.
4. call this function 'io_test' by using the keyword *native* in a Level2 MetaSL shader:

input:
String data_file;
//snip...

Scalar data_value;
data_value = native io_test(data_file);

----------------------------------------------------

I'm wondering if my expectation is right or not...
I would be happy if there are sample codes
for the implementation of 'native functions' like a 'nf_test.cpp'
and the calling them in a Level2 MetaSL shader.



Also, a Level3 MetaSL shader seems to have the ability of accessing to all the features of C++.
I shall be happy if there are sample codes for this as well.


Best regards,

--katsu

ak
January 21st, 2008, 11:21
Hello katsu,

I will forward your question to the MetaSL experts. Please stay tuned ...

katsu
January 22nd, 2008, 05:36
Dear ak,

Thank you very much for your kindness ...
Now, I face the trouble like a 'C++ Compiler Reference on Windows ' and 'compiling MetaSL' topic,
and try to solve it by reading these hints.
So, I would be happy if you let me know when the answer returns from MetaSL exports.

Again, I appreciate what you've done for me.

Best regards,

--katsu

ak
January 22nd, 2008, 10:20
Here is what I found out from the MetaSL experts:
"Native functions are supported in MetaSL, but not in RealityServer or the mental mill stand-alone application at the moment. They are however supported when using the mental mill SDK (Integrator Edition)."

This might not be very helpful for you (sorry for that), but it clarifies the situation ...

katsu
January 22nd, 2008, 12:57
Dear ak,

Thank you very much for your reply.


Here is what I found out from the MetaSL experts:
"Native functions are supported in MetaSL, but not in RealityServer or the mental mill stand-alone application at the moment. They are however supported when using the mental mill SDK (Integrator Edition)."


I would be happy if I have one more question ...
How can I use the mental mill SDK (Integrator Edition) ?
Can I use it if I obtain commercial licenses of RS or Luminova?


Best regards,

--katsu

ak
January 22nd, 2008, 16:30
How can I use the mental mill SDK (Integrator Edition) ?


Case of a mill SDK release, you will find an official announcement on the mental images (http://www.mental.com) website.