Recommended Posts

Does anyone know how to achieve gradient background (if possible at all) in POVRay's script?

"Normal" solid color script looks like this:

background
{
 color rgbt <100/255, 100/255, 100/255, 0>
}

I did try every possible combination with texture{}, pigment{}, gradient y{} and color_map{} but no success - POVRay stops at this script part all the time so even I miss something important or there is no real option for gradient background in POVRay. :hmpf_bad::sceptic::look:

Reason for this is that I would like to replace my existing "space" background in MOC that I need to make additionaly in external SW after rendering in POVRay (see below) with two-color gradient...cos I really like those backgrounds in 80's LEGO sets catalogues (mainly Classic Space). :laugh::grin::tongue:

post-55103-0-46427500-1409083713_thumb.jpg

Share this post


Link to post
Share on other sites

What if you render with only partial surface and the rest transparent so you can add abckground later?

But that is exactly what I am trying to avoid: finishing/adding bg in some external SW + except that as I am using reflections on base plain there is no option having both bg transparent and also just those reflections, there is only option having transparent sky part with solid base plane and yet if you looking at model from specific angle it may happen that sky is not visible at all thus having solid bg again.

Share this post


Link to post
Share on other sites

Check this sample.

Hey guys, thanx for the links but actually I know all of that.

Sadly it's not what I want or better said it does not suit exactly my needs, not what I am trying to achieve, see: with every MOC I create in LDD my camera angle and position are different so sometimes...many times, sky is not even visible because of used camera angle, therefore solution with sky gradient would not work for me...I know it as I was playing with it some time before, sorry... :sceptic:

Also pigment does not work for background, it can be solid color only, so that one is also "no-go"... :cry_sad: Maybe base plane gradient would work but I was not able find out the right script/syntax for this as I am using also floor reflections with "while()" iteration that seems to be in conflict with gradient for base plane...or at least I do not know how to do it right at this stage of knowlege of POVRay scripting code syntax (as I am programmer but in different languages)... :hmpf_bad:

GOOD NEWS

Last night after posting this post I was playing quite hard with the script till 03:00 morning... :grin: ...and successfully made what I wanted...in a way :sceptic::devil: ...I made simple polygon via POVRay's script containing my pre-made background.png that I've placed and rotated in appropriate coordinates BUT now I am facing new problem: as I said above my camera angles are changing all the time with every render so when I place such rectangle for one set with specific camera angle and position and then use it for another MOC it is out of right coordinates - polygon, basically a simple rectangle, is in wrong position not facing camera.

Sooooo now I need to know how to obtain camera position with every MOC I am rendering and then I can use those values to make code that would make my bg rectangle always facing camera in right position and angle... :wink::sweet:

Therefore new updated/related question: does anyone know how to obtain camera coordinates/values via POVRay script? :laugh:

Share this post


Link to post
Share on other sites

UPDATE:

Hey, guys, I am almost there - solution seems to be adding second separate plane{} with the gradient only before my reflection plane{}...still playing with it tho. :wink:

Share this post


Link to post
Share on other sites

LDD2POVRay files contain camera definition based on variables, so you can use them to position also your plane.

Sadly it's not what I want or better said it does not suit exactly my needs, not what I am trying to achieve, see: with every MOC I create in LDD my camera angle and position are different so sometimes...many times, sky is not even visible because of used camera angle, therefore solution with sky gradient would not work for me...I know it as I was playing with it some time before, sorry... :sceptic:

So you actually do not need gradient background. At least not in terms of POV-Ray's background.

And you will probably not achieve smooth transition between two planes - background and floor. There will be always a line visible.

Share this post


Link to post
Share on other sites

LDD2POVRay files contain camera definition based on variables, so you can use them to position also your plane.

Right: I know that and that was exactly what I was asking for if anyone knows names of those vars but I had to find them myself again, so if no one else knows them and would like to use them here they are (they are defined for every conversion inside concrete .pov file during LDD2POVRay conversion):

ldd_camera_transformation
ldd_camera_location
ldd_camera_distance
ldd_camera_look_at
ldd_camera_angle

So you actually do not need gradient background. At least not in terms of POV-Ray's background.

As you said I should clarify what I meant by "background" first: you are right that I am not talking about bg in POVRay's terms, my "background" means ANYTHING behind/under my MOC...that said basically I meant "base plane and background combined into one continuos transition", but most of the transition being in base plane cos as I said elsewhere there are some MOC renders that do not show background/sky at all depending on camera angle.

And you will probably not achieve smooth transition between two planes - background and floor. There will be always a line visible.

Well, I have achieved that smooth transition but in a bit different kind of way described above in my previous post, hrontos :tongue::grin::wink: Now I am only sorting out some details...

BTW: now new problem occures: for some reason nevermind radiosity type or Anti Aliasing I choose I have some strange grain on transparent edges...you can see it on pic in my initial post of this post...why? What parameter exactly manages this? Being lost right now... :look::cry_sad:

Edited by bublible

Share this post


Link to post
Share on other sites

@hrontos here is my smooth transition between baseplane and background "trick" (MOC final version render actually avaiting LEGO Ideas acceptance):

691309_1280x720.jpg

Edited by bublible

Share this post


Link to post
Share on other sites

Hey guys, you know what? Finally solved it to the point I am absolutely satisfied with (as for the possibility of the "gradient background" for our photorealistic render in POV-Ray, or even better said: ability having smooth cross between the baseplane and background without that hard horizon separating line...voila, here we go...after a half year of testing and trying! :D) - this is one of my latest MOC renders with my "backround trick" applied... :wink:

691509_640x360_001.png

Share this post


Link to post
Share on other sites

The result above is very good!

How much time did it took to be rendered and on which machine?

At the end of the day, the time necessary for a render is the main limit of powray.

Share this post


Link to post
Share on other sites

The result above is very good!

How much time did it took to be rendered and on which machine?

At the end of the day, the time necessary for a render is the main limit of powray.

Thanx...it wasn't that much time expensive - this 640x360 sized picture with the custom camera focal blur settings (defined manually in the .ini), several lights (4 from LDD-to-Povray GUI + additional custom one defined manually in the .ini) and my custom background trick in place took me about not more than 3 hours (without the focal blur it takes like 2 hours), on 6-core 3,2GHz AMD machine with 8GB DDR and quite simple rather low-end VGA ATI Radeon 4600 with passive cooling on Windows 7 64bit. :wink: .

+ also need to add that I actually edited the materials too so it is a bit more work but I guess the results earned it...at least for me :wink:

BTW: this is the one that took 2 hours to render...

691509_640x360.png

Edited by bublible

Share this post


Link to post
Share on other sites

What I usually do to get a smooth shaded background is just simulating the background real life photographers use.

gradient_1.jpg

gradient_2.jpg

gradient_3.jpg

Unfortunately I have to admit that you need to have some povray skills for implementing such a background.

But maybe Hrontos is such extremely excited now that he is willing to add this background feature to LDD2Povray so as to make it easy to use. :wink:

Regards

Papacharly

Share this post


Link to post
Share on other sites

What I usually do to get a smooth shaded background is just simulating the background real life photographers use.

Unfortunately I have to admit that you need to have some povray skills for implementing such a background.

But maybe Hrontos is such extremely excited now that he is willing to add this background feature to LDD2Povray so as to make it easy to use. :wink:

Regards

Papacharly

Well, actually, you do not need Hrontos nor his SW for that (as its SW basically pick some basic attributes of PovRay and make it easier to adjust them for those having no skills in PovRay scripts + of course, it enables us using our .lxf directly with PovRay and that is the main purpose of his LDD-to-Povray SW which is feature we will be thankful for forever :wink: ), you only have to make Polygon in Povray and bend it, but I chosen somewhat easier approach (well, from my point of view, that do not require no extra special skills in PovRay although one needs to know things or two about PovRay scripts anyway :wink: )

Edited by bublible

Share this post


Link to post
Share on other sites

Well, actually, you do not need Hrontos nor his SW for that (as its SW basically pick some basic attributes of PovRay and make it easier to adjust them for those having no skills in PovRay scripts + of course, it enables us using our .lxf directly with PovRay and that is the main purpose of his LDD-to-Povray SW which is feature we will be thankful for forever :wink: ), you only have to make Polygon in Povray and bend it, but I chosen somewhat easier approach (well, from my point of view, that do not require no extra special skills in PovRay although one needs to know things or two about PovRay scripts anyway :wink: )

So,,I was just looking into "Povray bending" and it simply CAN NOT BE DONE IN POVRAY itself according to its knowledge base here http://wiki.povray.o...d_Tips#Topic_11 (well, at least not directly when we are talking about base plane or polygon).

That said my "background trick" seems to be one of the few solution for Povray (if not the only one at this time as I do not know about any other dealing with this in Povray). :classic:

Anyway if I am wrong please correct me. :thumbup:

Edited by bublible

Share this post


Link to post
Share on other sites

Hi,

I just prepared some more detailed description of the images above. The background consists of 2 geometric shapes: a segment of cylinderringand a box. The box is not required as there usually is a floor instead. The following code works for povray files generated with LDview. For LDD2povray you may have to adapt it.

So it should be easier to discuss it or to copy it.

povray.jpg

Additionally you may have to add some povray inc-files (e.g. for segment of cylindering shapes3.inc is required):

#include "transforms.inc"

#include "shapes.inc"

#include "shapes3.inc"

BTW: When I speak about "you" this always means "people" or "all povray users". Sorry, if there might have been some kind of misunderstanding.

regards

papacharly

Share this post


Link to post
Share on other sites

sorry but your code does not work at all + also it does not do what I am doing: not just seamles gradient between baseplate and background, but also gradient from one color to another + reflection only from one color :wink:

right now I am working on more advanced version of my "background trick" (or call it whatever you like) where I implemented hacked/simulated bending of the baseplane, no need for external scripts (as in your example - once again: Povray is unable bending objects directly, I posted link about it above in previous post, your script uses external script as I understand it)

P.S.: I just made it - script is finished now! :classic:

Edited by bublible

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.