Jump to content

Port of VEX shadeop to RMan RSL plugin


mauritius

Recommended Posts

I needed to render some ocean, but in 3Delight. So I 'ported' the VEX shadeop to RMan. The code is only tested with 3Delight on win32 but I'm confident it should work on Linux/OSX and with PRMan as well. This is a "new school" RSL plugin shadeop, so it processes entire grids instead of single shading samples.

The shadeop works in multi-threaded mode in 3Delight and I'm confident it should as well in PRMan.

Let me know if anyone wants the copy or if you want to make this part of the HOT package.

Cheers,

Moritz

P.S.: This shit is HOT! Thanks heaps for this! It saved my ass on this super-tight-deadline[tm] shot. :notworthy:

Edited by mauritius
Link to comment
Share on other sites

I actually attempted this last weekend, but with the old-school single-threaded style DSO shadop method. I'm still not very good with all the C/C++ data maintenance stuff so it ran up to about 5 gigs when I rendered a simple frame and seg faulted. hehe Anyways, I would love to see how you did this, and it would be very useful for my studies if you wouldn't mind sharing.

Post here, or send it to bluemoonshine (at) gmail (dot) com

I can test it with prman 14.1

Thanks a bunch for sharing :)

and thanks to Drew as well. Having the source to something like HOT is very educational.

Link to comment
Share on other sites

Hi Moritz,

I'd like to see the code, and I'd be happy to include it with the HOT although I'm not sure I could keep it maintained as we don't use prman these days. At the least we can make it available from the odwiki page. It would be great if you also give us a sample rib that demonstrates the shadeop.

I put a bit of effort into the core of the code (Ocean.h) to keep it clean and HDK independent so that it would be easy to insert into other platforms. So now it's made it into mental ray (twice but neither parties released the code), blender and rman. The HOT is my atonement for the vast array of open source software that I use daily, success stories like this make me all warm an fuzzy. Though

...

-Drew

I needed to render some ocean, but in 3Delight. So I 'ported' the VEX shadeop to RMan. The code is only tested with 3Delight on win32 but I'm confident it should work on Linux/OSX and with PRMan as well. This is a "new school" RSL plugin shadeop, so it processes entire grids instead of single shading samples.

The shadeop works in multi-threaded mode in 3Delight and I'm condifent it should as well in PRMan.

Let me know if anyone wants the copy or if you want to make this part of the HOT package.

Cheers,

Moritz

P.S.: This shit is HOT! Thanks heaps for this! It saved my ass on this super-tight-deadline[tm] shot. :notworthy:

Link to comment
Share on other sites

Hey Drew,

I'd like to see the code, and I'd be happy to include it with the HOT although I'm not sure I could keep it maintained as we don't use prman these days. At the least we can make it available from the odwiki page. It would be great if you also give us a sample rib that demonstrates the shadeop.

code is attached. This also contains a CMake file for this and a CMake module to find 3Delight. I dropped SCons for CMake a while back. :)

I'll see if I can prep a little demo RIB next week. Feel free to do with this source whatever you like; I can't claim much credit in it anyway. Porting this from your VEX shadeop and making sure it works took less than an hour. ;)

Beers,

Moritz

RSL_ocean.zip

Link to comment
Share on other sites

  • 3 months later...

Hey Moritz

I think it would make sense to have the Maya plugin in with the rest of the source

If others think that is a bad idea, if you could host it elsewhere that would be great

Im in the process of updating to cmake 2.6 so I can build your shadeop

seems like it should be a fun thing to play with

Sam

Link to comment
Share on other sites

cmake isnt really working for me

samh@trevor /media/HOT_src_1.0rc6/src $ cmake .

-- Configuring done
CMake Error in CMakeLists.txt:
  Cannot find source file "RSL_ocean.cpp".  Tried extensions .c .C .c++ .cc
  .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx


-- Build files have been written to: /media/HOT_src_1.0rc6/src

here is my CMakeList.txt, which is a little bit edited

samh@trevor /media/HOT_src_1.0rc6/src $ more CMakeLists.txt

set( CMAKE_CONFIGURATION_TYPES "Release" CACHE STRING "" FORCE )
set( CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE )
cmake_minimum_required( VERSION 2.6 )
project( ocean )


add_definitions( -D_Windows )

include_directories( 3rdparty/include )
include_directories( 3rdparty/include/loki )
include_directories( 3rdparty/include/loki/flex )
include_directories( 3rdparty/include/loki/yasli )
include_directories( 3rdparty/win32 )
include_directories( /opt/3delight/3delight-7.0.0/include)

add_library( ocean SHARED /media/HOT_src_1.0rc6/src/RSL_ocean.cpp )

target_link_libraries( ocean /opt/3delight/3delight-7.0.0/lib)
target_link_libraries( ocean 3rdparty/win32/blitz )
target_link_libraries( ocean 3rdparty/win32/libfftw3f-3 )

what is wrong with this?

g++ -I 3rdparty/linux/include -I 3rdparty/include  -I /usr/include  -I /opt/3delight/3delight-7.0.0/include -L /opt/3delight/3delight-7.0.0/lib -L 3rdparty/linux/lib -L/usr/lib -l3delight -lfftw3f  -lblitz RSL_Ocean.cpp

I still havent studies up on linking properly, I will see if I can get this build happening a little better

Link to comment
Share on other sites

what is wrong with this?

g++ -I 3rdparty/linux/include -I 3rdparty/include  -I /usr/include  -I /opt/3delight/3delight-7.0.0/include -L /opt/3delight/3delight-7.0.0/lib -L 3rdparty/linux/lib -L/usr/lib -l3delight -lfftw3f  -lblitz RSL_Ocean.cpp

I still havent studies up on linking properly, I will see if I can get this build happening a little better

Goddamn sam!

sifnt google shadeop 3delight

http://www.3delight.com/en/uploads/docs/3d...delight_78.html

g++  -shared -I 3rdparty/include  -I /usr/include  -I/opt/3delight/3delight-7.0.0/include -L/usr/lib -lfftw3f  -lblitz -l3delight RSL_Ocean.cpp -o ocean.dso

This works

I installed fftw_3.2 blitz_0.9 and lib_compat_loki_0.2 on my host gentoo system, so thier headers/libs are at /usr/include /usr/lib respectively now I should compile the shader make a plane and see what happens!

Link to comment
Share on other sites

  • 1 year later...

Could you help me please with compilation of RSL_Ocean.cpp for windows x64 ?

I have compiled RSL_Ocean.cpp with command

cl /I"c:/src/3rdparty/win64" /I"c:/src/3rdparty/include" /I"c:/src/3rdparty/include/loki" /I"c:/src/3rdparty/include/loki/flex" /I"c:/src/3rdparty/include/loki/yasli" /I"%DELIGHT%/include" "c:/src/3rdparty/win64/blitz.lib" "c:/src/3rdparty/win64/libfftw3f-3.lib" "%DELIGHT%/lib/3delight.lib" /LD /EHsc "c:/src/RSL_Ocean.cpp"

the builded file RSL_Ocean.dll and libfftw3f-3.dll were placed to the folder /3Delight/shaders/

but when I tried to compile shader with the command shaderdl ocean_eval.sl , it has crushed.

What am I doing incorrectly?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...