Render.ru

ribgen's for rat

Narvi

Активный участник
Рейтинг
11
#1
Я так понимаю тут есть особо продвинутые люди которые субжи пишут? А не поделитесь инфой? Типа какой компилятор нужен, как их вообщем писать.. В доке очень мало, по примерам вообщем тоже тяжко разбираться...
 
#2
Ну придется. Я например только по примерам и разбираюсь. Я пока еще не сделал, но где-то в серединке. Я пишу на MSVC 6.0. Но лучше спросить у людей более грамотных - у JinDOS'а например, он свой рибгер еще года два назад написал и судя по моей инфе его фур намного превосходит по наворотам, гибкости и производительности стандартный mtorUltraFur.
 
#3
MSVС++, т. к., в отличие от Unix с Windows не поставляется компилятор С++ .
В MSVС++ допонительно прописать пути к папкам c файлами *.lib и *.h из рендермана. Tools->Options->Directories
4. Прописать, какие конкретно файлы *.lib будут испльзоваться при компиляции. Project->Settings->Link->General.
5. Для устранениея ошибки:
LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
Неободимо в Project->Settings->Link->Project Options прописать /NODEFAULTLIB:libcmt.
Когда получится твой_файл.ехе: твой_файл.ехе > файл.риб - получится запись на диск, твой_файл.ехе | prman.exe - получится рендеринг прманом, риб будет «входит» в prman.exe через stdin.




Cicero Tullius <cicero@directvinternet.com> wrote:
> So where is the documentation on building an executable using the C API?

Here are instructions for compiling an RI program with Visual C++ from
the command line (i.e. DOS prompt). Some people prefer to use the
Integrated Development Environment.

1. Locate your renderer's include directory. It will be under the root
directory where the renderer was installed, probably called "include",
and will contain a file called "ri.h". Below, I will refer to this
directory as %INCDIR%

2. Locate the lib directory. It will probably be a sibling directory of
%INCDIR% called "lib" and will contain files with the ".lib" extension.
Let %LIBDIR% refer to this directory.

3. Pick a library in %LIBDIR% that implements the RenderMan Interface.
If you want your program to generate RIB, look for a file that has "rib"
in its name and ends with ".lib". I will refer to this file as %LIBNAME%
Depending on which renderer you use, there could be other libraries that
actually render an image when you run your program.

4. Open a DOS prompt. To run Visual C++ from the command line you may
need to locate and run a batch file called "vcvars32.bat". Then, go to
the directory where your C file is. If its name is "sphere.c", the
command would look like this:

cl -I%INCDIR% sphere.c -link -libpath:"%LIBDIR%" %LIBNAME%

If you're using PRMan, it will say "unresolved external symbol _gzdopen"
at this point. Add "libzip.lib" to the command line:

cl -I%INCDIR% sphere.c -link -libpath:"%LIBDIR%" librib.lib libzip.lib

The executable will be called "sphere.exe".

> I need to know which libraries should be included for the linker in linux
> and win nt.

The exact name of the library depends on which renderer you use. Look
for "*rib*" in LIBDIR and you can't go wrong.

For Linux, repeat steps 1 through 4 with the following modifications:

1. Let $INCDIR be the include directory.

2. The lib directory will contain files that start with "lib" and end with
the ".a" or ".so" extension. Let $LIBDIR be this directory.

3. Let $LIBNAME be the file name with the "lib" prefix and ".a" or ".so"
suffix removed. For example, "librib.a" becomes simply "rib".

4. Open a shell and go to where your C file is.

g++ -I$INCDIR sphere.c -L$LIBDIR -l$LIBNAME -o sphere

The executable will be called "sphere".


LINKS www.affine.org





1. А ribbtree у Вас скомпилилось? Для компиляции Ribtree нужен хедер ripriv.h из Affine Toolkit, а я забыл Вам его кинуть.

2. Если ribtree.c Вы можете просто открыть в Visual Studio и скомпилить его просто как консольное приложение, то для menger.c вы должны создать проект Win32 Dynamic-Link Library.

4. В Tools->Options->Directories у Вас должны быть прописаны пути:
C:\Pixar\prman-10.0\include
C:\Pixar\prman-10.0\lib
C:\affine0008\include (для ribtree, для menger не надо)
в соответствующих местах (library files, include files...)

В Project->Settings->Link->Obect/Library modules добавьте prman.lib

5. Для компиляции menger совершаем следующие действия:
New->Projects->Win32 Dynamic-Link Library->Empty DLL Project

Project->Add To Project->Files->menger.c

Build->Build menger.dll
 
#4
MSVС++, т. к., в отличие от Unix с Windows не поставляется компилятор С++ .
В MSVС++ допонительно прописать пути к папкам c файлами *.lib и *.h из рендермана. Tools->Options->Directories
Прописать, какие конкретно файлы *.lib (prman.lib) будут испльзоваться при компиляции. Project->Settings->Link->General.
Для устранениея ошибки:
LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
Неободимо в Project->Settings->Link->Project Options прописать /NODEFAULTLIB:libcmt.

Когда получится твой_файл.ехе: твой_файл.ехе > файл.риб - получится запись на диск, твой_файл.ехе | prman.exe - получится рендеринг прманом, риб будет «входит» в prman.exe через stdin.

Можно скомпилить dll.
New->Projects->Win32 Dynamic-Link Library->Empty DLL Project

Project->Add To Project->Files->твой файл.c

Build->Build твой файл.dll
Делаешь на тего ссылку в рибе:
Procedural "DynamicLoad"
[ "твой файл.dll" "2 -1 1 -1 1 -1 1" ]
[ -1 1 -1 1 -1 1 ]
с параметрами, например 2, и боундинг боксом -1-1-1 111



Cicero Tullius <cicero@directvinternet.com> wrote:
> So where is the documentation on building an executable using the C API?

Here are instructions for compiling an RI program with Visual C++ from
the command line (i.e. DOS prompt). Some people prefer to use the
Integrated Development Environment.

1. Locate your renderer's include directory. It will be under the root
directory where the renderer was installed, probably called "include",
and will contain a file called "ri.h". Below, I will refer to this
directory as %INCDIR%

2. Locate the lib directory. It will probably be a sibling directory of
%INCDIR% called "lib" and will contain files with the ".lib" extension.
Let %LIBDIR% refer to this directory.

3. Pick a library in %LIBDIR% that implements the RenderMan Interface.
If you want your program to generate RIB, look for a file that has "rib"
in its name and ends with ".lib". I will refer to this file as %LIBNAME%
Depending on which renderer you use, there could be other libraries that
actually render an image when you run your program.

4. Open a DOS prompt. To run Visual C++ from the command line you may
need to locate and run a batch file called "vcvars32.bat". Then, go to
the directory where your C file is. If its name is "sphere.c", the
command would look like this:

cl -I%INCDIR% sphere.c -link -libpath:"%LIBDIR%" %LIBNAME%

If you're using PRMan, it will say "unresolved external symbol _gzdopen"
at this point. Add "libzip.lib" to the command line:

cl -I%INCDIR% sphere.c -link -libpath:"%LIBDIR%" librib.lib libzip.lib

The executable will be called "sphere.exe".

> I need to know which libraries should be included for the linker in linux
> and win nt.

The exact name of the library depends on which renderer you use. Look
for "*rib*" in LIBDIR and you can't go wrong.

For Linux, repeat steps 1 through 4 with the following modifications:

1. Let $INCDIR be the include directory.

2. The lib directory will contain files that start with "lib" and end with
the ".a" or ".so" extension. Let $LIBDIR be this directory.

3. Let $LIBNAME be the file name with the "lib" prefix and ".a" or ".so"
suffix removed. For example, "librib.a" becomes simply "rib".

4. Open a shell and go to where your C file is.

g++ -I$INCDIR sphere.c -L$LIBDIR -l$LIBNAME -o sphere

The executable will be called "sphere".


LINKS www.affine.org





1. А ribbtree у Вас скомпилилось? Для компиляции Ribtree нужен хедер ripriv.h из Affine Toolkit, а я забыл Вам его кинуть.

2. Если ribtree.c Вы можете просто открыть в Visual Studio и скомпилить его просто как консольное приложение, то для menger.c вы должны создать проект Win32 Dynamic-Link Library.

4. В Tools->Options->Directories у Вас должны быть прописаны пути:
C:\Pixar\prman-10.0\include
C:\Pixar\prman-10.0\lib
C:\affine0008\include (для ribtree, для menger не надо)
в соответствующих местах (library files, include files...)

В Project->Settings->Link->Obect/Library modules добавьте prman.lib

5. Для компиляции menger совершаем следующие действия:
New->Projects->Win32 Dynamic-Link Library->Empty DLL Project

Project->Add To Project->Files->menger.c

Build->Build menger.dll
 

bog

Активный участник
Рейтинг
5
#5
Ну я не делал всего что ты советуешь - я подправил файл ribgen.h и добавил несколько строк в заголовок главного файла проекта, я свой рибген уже собрал, это рибген для волос, но с множеством всяких фичей - типа клампинга, собственный шейдер для волос ну и т. д. При сборке основная проблема в том, что исходники-то юниксовые. Из-за этого могут быть небольшие грабли.
 
Сверху