sidebar features
sidebar content

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

Reply
 
Thread Tools
Kai Kostack's Avatar
Kai Kostack Kai Kostack is offline
Member
 
Join Date: Jun 2006
Location: Berlin, Germany
Posts: 608
hi,

i had another strange idea. now it's the implementation of micropolygons via python. it's probably the worst implementation of micropolygons ever made, because it's so slow and needs unbelievable amounts of memory but at least it works.

here are some examples with different settings originally rendered in DVD resolution:



this is the base mesh, a plane and a low poly icosphere. i just added a material with a procedural displacement texture to it and ran the script.



division rate of 16 pixel/poly, average of 10 seconds per frame calculation time, up to 250 mb memory use



division rate of 8 pixel/poly, average of 45 seconds per frame calculation time, up to 500 mb memory use



division rate of 4 pixel/poly, average of 2:30 minutes per frame calculation time, up to 1 gig memory use

highres videos

unfortunately you can't reach very high detail for instance 1 pixel/poly in higher resolutions, it simply cost to much memory and will crash blender.

i still need to do some improvements then i'll release it.
............................................
My latest work: Commercial short film for ZOTAC
http://www.KaiKostack.com
#1   Old 11-Mar-08, 13:46   
Reply With Quote


ibkanat's Avatar
ibkanat ibkanat is offline
Member
 
Join Date: Nov 2005
Location: Montana
Posts: 570
Hey great work....
#2   Old 11-Mar-08, 13:48   
Reply With Quote
JiriH's Avatar
JiriH JiriH is offline
Member
 
Join Date: Dec 2005
Posts: 1,564
You are saying that you was able to code python script for micropoly rendering? You are really genius man !!!
#3   Old 11-Mar-08, 13:51   
Reply With Quote
gaalgergely's Avatar
gaalgergely gaalgergely is offline
Member
 
Join Date: Sep 2006
Posts: 313
that looks very interesting! :O
please, release the python script as soon as you can, so others could take a look at it and add a few optimisations.
simply incredible! wow!
just to clarify: this is true micropoly and not just simple cc-subdivision, right?
#4   Old 11-Mar-08, 14:18   
Reply With Quote
meschoyez's Avatar
meschoyez meschoyez is offline
Member
 
Join Date: Dec 2006
Location: Córdoba, corazón de mi país ;) Argentina
Posts: 751
Kai, you're really a mad man... micropolygons, demolition... wooooow, man.... i've no words...
............................................
my Flickr Gallery
my videos

www.epanimation.com.ar | my studio
#5   Old 11-Mar-08, 15:39   
Reply With Quote
ideasman42's Avatar
ideasman42 ideasman42 is offline
Member
 
Join Date: Mar 2004
Location: Australia
Posts: 3,490
Gosh, even Brecht didnt have the balls to finish micropoly rendering!
I hope your able to refine this into something faster
Ideally you will only subdivide polys for a 32x32 bucket at a time, then render them and throw it away.
You could use the render api's border render access for that.
............................................
BPython Cookbook * How to get features into Blender * Code Metrics
Hire Me
ideasman42<at>gmail.com
#6   Old 11-Mar-08, 16:27   
Reply With Quote
Kai Kostack's Avatar
Kai Kostack Kai Kostack is offline
Member
 
Join Date: Jun 2006
Location: Berlin, Germany
Posts: 608
@gaalgergely:
no cc, we have this already.
this kind of subdivision depends on the camera position, lens, render resolution etc.



@ideasman42:
at the moment it works very simple and wasteful regarding memory consumption.
as you can see it simply subdivides everything around the camera.
do you know of a fast way to check if a 3d point or edge is within the viewfield of the camera? and i mean really fast, otherwise it would probably become even slower.
............................................
My latest work: Commercial short film for ZOTAC
http://www.KaiKostack.com
#7   Old 11-Mar-08, 20:39   
Reply With Quote
migius's Avatar
migius migius is offline
Member
 
Join Date: Mar 2005
Location: Berlin, Germany
Posts: 588
Kai, i am happy to see you again with this innovative idea.
Really amazing that you get it working in python.
respect
migius
............................................
projects: CAD-tools, DXF-Exporter, DXF-Importer, Image Browser, BPyBrowser
#8   Old 11-Mar-08, 22:54   
Reply With Quote
Ace Dragon's Avatar
Ace Dragon Ace Dragon is offline
Member
 
Join Date: Feb 2006
Location: Wichita Kansas
Posts: 14,104
You probably can start to do major optimizations because that way it would be a lot more usable, Ideasman is a genious at python, he can help you.

A good thing would be to greatly optimize the script then port it to C to have it hardcoded into Blender.
............................................
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.
#9   Old 12-Mar-08, 02:21   
Reply With Quote
J09's Avatar
J09 J09 is offline
Member
 
Join Date: Jan 2007
Posts: 1,461
I know that (at least in the GE) the command for checking if a camera can see [something] is something about the frustum. Real helpful, I know. I looked in the API for general python (not limited to GE) and only came up with this:
http://www.blender.org/documentation...html#glFrustum
I have little idea how to use it, but I'm hoping it might help.....
#10   Old 12-Mar-08, 02:50   
Reply With Quote
Jeremy Ray Jeremy Ray is offline
Member
 
Join Date: Nov 2006
Posts: 911
Yay for finally getting micropoly into Blender! Even if it's just a start!
#11   Old 12-Mar-08, 04:03   
Reply With Quote
Anthony's Avatar
Anthony Anthony is offline
Member
 
Join Date: Jan 2006
Location: Hamilton
Posts: 595
Isn't this basically just LOD?
............................................
"Godammit Jenkins, Fire your weapon!"
#12   Old 12-Mar-08, 04:57   
Reply With Quote
Michael W's Avatar
Michael W Michael W is offline
Member
 
Join Date: Nov 2007
Posts: 3,185
Quote:
Originally Posted by Anthony View Post
Isn't this basically just LOD?
Lod takes a high poly mesh and decimates(removes polygons) it as it gets further away.

This seems to take a mesh and tessellates (adds polygons) as it gets closer. In this case those extra polygons are then displaced by a procedural to add geometry detail.

Looks like a cool thing!

On optimising...
I guess it'd be really tough to figure out localised subdivision based on the displacement "rate of change"... probably take the calculation time through the roof! might help memory though.
............................................
Mike Williamson
www.cowtoolsmedia.co.uk
#13   Old 12-Mar-08, 07:41   
Reply With Quote
Kai Kostack's Avatar
Kai Kostack Kai Kostack is offline
Member
 
Join Date: Jun 2006
Location: Berlin, Germany
Posts: 608
i could imagine this being a modifier in blender. it'd need just two inputs, the preview subdivision rate and the render division rate in pixel/poly. the preview rate would be useful to tweak possible following displacement modifiers etc. with a low poly rate.

the idea behind this script is that simple, that i can quick explain it in pseudo-code here:

Code:
repeat: for all edges in the mesh do: if lengthOfEdge > (((16 /lensInMM) *distanceOfEdgeCenterToCamera *2) /renderResolutionMaxX) *divisionRate then: subdivideEdge() do this until no more edges are found to be subdivided
that's the central (although simplified) algorithm, nothing very complicated. i think a good coder could make such a modifier ready in a really short amount of time. if i could be sure it would make it into the main trunk, maybe then i'd do it myself.


btw, i thought about the viewfield/bucket problem. an assumed subdivided vertex which would be outside of this window could be pushed into it by a displacement anyway, so you can't basically say everything outside of the viewfield isn't needed. another thing are mirrors, you'd have to check also what can be seen in reflective surfaces. this could become a coding nightmare. so viewfield dependend subdivision should only be an option, it depends strongly on your scene if it can be used without glitches.
............................................
My latest work: Commercial short film for ZOTAC
http://www.KaiKostack.com

Last edited by Kai Kostack; 14-Mar-08 at 03:23. Reason: corrected the code
#14   Old 12-Mar-08, 08:11   
Reply With Quote
Meta-Androcto's Avatar
Meta-Androcto Meta-Androcto is offline
Member
 
Join Date: Aug 2006
Location: australia
Posts: 2,579
congrats.
great work, very useful.
Quote:
i had another strange idea.
have as many as you like!
m.a.
#15   Old 12-Mar-08, 09:17   
Reply With Quote
Kai Kostack's Avatar
Kai Kostack Kai Kostack is offline
Member
 
Join Date: Jun 2006
Location: Berlin, Germany
Posts: 608
i did some optimizations for motion blur and another example:

............................................
My latest work: Commercial short film for ZOTAC
http://www.KaiKostack.com
#16   Old 12-Mar-08, 12:24   
Reply With Quote
Surt's Avatar
Surt Surt is offline
Member
 
Join Date: May 2004
Location: Brisbane, Australia
Posts: 302
Really impressive stuff.

Any plans to add interpolated transitioning between subdivision levels to minimise popping/banding?
............................................
"...oppression and happiness...not necessarily mutually exclusive." - Cessen
#17   Old 12-Mar-08, 12:41   
Reply With Quote
Meta-Androcto's Avatar
Meta-Androcto Meta-Androcto is offline
Member
 
Join Date: Aug 2006
Location: australia
Posts: 2,579
kai, that looks great.
Drools.....
#18   Old 12-Mar-08, 12:44   
Reply With Quote
pixel master pixel master is offline
Member
 
Join Date: Feb 2007
Posts: 193
Kai. I'm loving the Star Trek 2 feel of your test.
#19   Old 12-Mar-08, 12:51   
Reply With Quote
Tea_Monster's Avatar
Tea_Monster Tea_Monster is offline
Member
 
Join Date: Feb 2006
Location: USA
Posts: 1,071
I'm not a coder, but could it be possible to adapt the code to 'C' so it could be rolled into the Blender core and speeded up?
............................................
My Portfolio - CG Society Portfolio Page
#20   Old 12-Mar-08, 19:01   
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 18:16.


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.
Blender Headlines
Featured Artwork
Crocodile by Julia Korbut
Classic vintage look renders by HANGAR
Blending life - Old George by bigbad
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.
Social BlenderArtists