sidebar features
sidebar content

Go Back   Blender Artists Forums > General Forums > Python & Plugins

Reply
 
Thread Tools
jmiller jmiller is offline
Member
 
Join Date: Sep 2009
Posts: 11
eeshlo released a python compiled texture plugin for sunsky. He did not release the source code, however, and the new version of python will not work with it, etc, etc. I am trying to write a new texture plugin.

I have stolen sunsky.cc from yafaray and as of today, I have managed to compile it independently of yafaray so I can convert it to a texture plugin for blender internal.

I need some help at this point. It would help me greatly if someone familiar with yafaray could help me with the interface for the background. I have a mostly complete class that used to inherit background_t, but I need to make some functions to get skycolor at specified x,y,z coordinates for the texture. Basically, I need a function like this:

sunsky_get_rgb(*rgb_struct, sun_x_dir, sun_y_dir, sun_z_dir, turb, x_coord, y_coord, z_coord, sun_intensity);

I of course want to eventually add lat/lon and day/time to the plugin for ease of use. Then a python script to do the sky and add a light in the correct position.

If anyone is interested, I have also managed to get sunsky compiled from Andrew's Code (http://www.cs.cmu.edu/~ajw/software/) for Ubuntu. I had to change some includes, change some cmath functions and change some C++ methods to inline but it compiles cleanly and renders sky in tiff format.

Thanks for any help.
#1   Old 20-Sep-09, 04:04   
Reply With Quote


jmiller jmiller is offline
Member
 
Join Date: Sep 2009
Posts: 11
OK, here's the source code. I managed to get this compiled and linked but it's all wrong. I don't know what I'm doing. sunsky.cc is copied from yafaray, but modified to be compiled independently. It only returns a single solid color. If someone familiar with yafaray could shed some light on what it's supposed to do, maybe I can get this corrected.

NOTE: The inputs for the plugin don't do anything. All the values except the coordinates are hard-coded at the moment. This is trivial to change, but I'm not adding any more complexity until I get some kind of positive result.

Files below (viewable without downloading/extracting):

http://www.calcmaster.net/blender/sunsky/
#2   Old 20-Sep-09, 14:12   
Reply With Quote
jmiller jmiller is offline
Member
 
Join Date: Sep 2009
Posts: 11
Ok, I have a basic plugin that generates sky. See the test render:



You can download source code and Ubuntu 9.04 (Jaunty) binary at:

http://www.calcmaster.net/blender/sunsky/

Special thanks to subcomandante for help with coordinates. I'm pretty sure that my implementation is still wrong, but it's something for now.
#3   Old 20-Sep-09, 19:44   
Reply With Quote
jmiller jmiller is offline
Member
 
Join Date: Sep 2009
Posts: 11
Ok, that first implementation was wrong, but who cares, I think I got it right now. And the picture should have looked like this:



http://www.calcmaster.net/blender/sunsky/
#4   Old 20-Sep-09, 23:47   
Reply With Quote
Ace Dragon's Avatar
Ace Dragon Ace Dragon is offline
Member
 
Join Date: Feb 2006
Location: Wichita Kansas
Posts: 14,006
Doesn't Blender already have a sun/sky type feature for sunlamps? I guess this would get points if it can be seen on raytraced reflections and through refracting objects.
............................................
Soar, soar through the skies upon the wings of anything that can fly, to bring your dreams to reality, to bring success upon you, to bring you a good life for you and your family. Not everyone can get to the point where you constantly draw 4 aces in a deck of cards, but everyone is able to taste what success feels like and what that can mean for them.
#5   Old 21-Sep-09, 03:10   
Reply With Quote
jmiller jmiller is offline
Member
 
Join Date: Sep 2009
Posts: 11
While the internal sky/atmosphere has more features at the moment, it doesn't create the same type of realistic sky colors that are available with the sunsky plugin, which is off of the same research paper as yafaray sunsky and Darktide sunsky. I am planning to implement integration with an actual sun as soon as possible as well as some of the other options like backscatter, etc.

Basically, the internal sky/atmosphere doesn't produce colors as accurately as this plugin does. See this thread:

http://blenderartists.org/forum/showthread?t=8369

My plugin aims to recreate that functionality which is missing due to binary incompatibilities and lack of source code.
#6   Old 21-Sep-09, 17:08   
Reply With Quote
steeve's Avatar
steeve steeve is offline
Member
 
Join Date: Dec 2008
Location: New Zealand
Posts: 340
still need to fully understand what's behind this, but it looks like it could be useful. will give it a try
#7   Old 21-Sep-09, 19:13   
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 23:33.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Logo and website design copyright © 2006 by froodee design bureau. All rights reserved.
Other Blender Sites
new icon Blender Homepage »
The official Blender homepage
new icon BlenderNation »
Fresh Blender News, Every Day
new icon Blenderart Magazine »
Blender articles, tutorials and images.
Blender Headlines
Featured Artwork
Short animation: Barrel by Phlopper
Woolly mammoth by sebastian_k
Photorealistic classic furniture by eMirage
Social BlenderArtists