msx80

[Software] Bluerender, a rendering engine for LDD

Recommended Posts

You're welcome! :) i've seen the renders in sci-fi, great models!

thank you, I am really starting to using your sw on regular basis from this point when it comes to super quick but still nicely artistic looking renders of MOCs' modularities as I said earlier and gotta say that more I am using it the more I like it...I would even say that from some perspective your renderer looks even better than some quicker Povray renders which alone - having on mind its speed - is really almost unbelievable, great! :thumbup:

Decors are on the way, both in blueprint and bluerender :)

SUPER!!! :thumbup: :thumbup: :thumbup: I am thrilled already (crossing my fingers you also implement decors replacement option like in ldd2povray, you probably should contact @hrontos as the function is his own so he could tell you how he made it)

Yes, the trasparents are way too dark, but i haven't been able to find a setting that looked better. If anyone want to tinker with the "materials" tab and find some decent values :)

No no no, please do not change anything: with the trans dark blue it looks better this way than in Povray when it makes its edges brighter which is completely wrong cos in reality with this color they should be darker (which I managed to achieve in Povray after some tweaking as you may see in my Povray renders in SciFi forum) :wink:

Edited by bublible

Share this post


Link to post
Share on other sites

Quad CC 24 floors of 29,000 pcs took only 1 min 18 sec!

Tried to add one more floor to reach 30,000 pces, but LDD crash while saving the file.

18228151376_7bd5d83fa8_c.jpgBluerender test by Nachapon S., on Flickr

4K 4096 x 3072 test:

-No plane = 9 min 48 sec

-Blue plane = 21 min 58 sec

Both use CPU 3 of 4 core to keep temperature around 70-80'C.

If run 100% CPU, it should be 20-25% faster.

18253692412_59ca3b2666_b.jpg

18071273569_2a820b563e_b.jpg

18071276969_a85b0aeaed_b.jpg

18069685638_248ddc3636_b.jpg

18070543469_535cc656a9_b.jpgBluerender 4K test 29K pcs 8min by Nachapon S., on Flickr

Edited by bbqqq

Share this post


Link to post
Share on other sites

SUGGESTION:

I see you have used variable/constant named "%LDDCAMERA%", I am suggesting moving its definition to Setup.txt file instead (in case it is applicable, of course :wink: ) so everyone can see how did you do that and can learn something new from it or use part of it elsewhere in the script (once again something like @hrontos did with his ldd2povray, I have learned a lot from his definitions)

Edited by bublible

Share this post


Link to post
Share on other sites

Here's a small preview :)

Looks GREAT! :thumbup:

Can't wait for the decal function update!

Me too as well...can't wait :wink:

SUGGESTION:

I have noticed that BlueRender does nor remember last directory used while still opened, so when I go to render another .lxf it opens by default its OPEN dialog window in BlueRender folder instead of previous .lxf folder - could you at least add an option to search in last selected directory instead of programs folder, please? :look:

Edited by bublible

Share this post


Link to post
Share on other sites

SUGGESTION:

individual settings - you could make your BlueRender so that it first search for those 3 .txt files in .lxf folder and if not found only then use the default ones from BR folder. This way we could very easily have our individual settings for every .lxf model and yet still having the default ones in case there are no those 3 files in the respective .lxf folder (in case the logic is one have every .lxf model in separate folder). :wink:

PROBLEM:

As I am playing with your SW more, or better said learning the SunFlow script with it I have noticed you probably not integrated it right or at least I am doing something wrong because in the SunFlow manual PDF on page 97 "Trace Depth" there seems to be a solution for the problem some of the users here had dealing with too dark trans part. But when I add that piece of code to the BlueRender (into Setup tab which should act as "the scene file") nothing happens, everything is still the same...could you, please, look at it? :look:

Edited by bublible

Share this post


Link to post
Share on other sites

SUGGESTION:

add brick seams - this should be quite easy to do by edge beveling OR by shrinking the size of every individual brick by "_a" in all dirs

brick.scale.x -= _a;

+ moving it 1/2 of the shrinking value on the scaled axis

brick._x += _a/2;

This way you should achieve "separation" between individual bricks = seams :wink:

Edited by bublible

Share this post


Link to post
Share on other sites

SUGGESTION:

I see you have used variable/constant named "%LDDCAMERA%", I am suggesting moving its definition to Setup.txt file instead (in case it is applicable, of course :wink: ) so everyone can see how did you do that and can learn something new from it or use part of it elsewhere in the script (once again something like @hrontos did with his ldd2povray, I have learned a lot from his definitions)

you mean replacing the code %LDDCAMERA% with its substitution? That would mean that the next time you render there would be no substitution, as there is no code (it works by simple string substitution). I could instead output the replaced string somewhere so users can see that.

SUGGESTION:

individual settings - you could make your BlueRender so that it first search for those 3 .txt files in .lxf folder and if not found only then use the default ones from BR folder. This way we could very easily have our individual settings for every .lxf model and yet still having the default ones in case there are no those 3 files in the respective .lxf folder (in case the logic is one have every .lxf model in separate folder). :wink:

I guess i could, but i'm afraid it would be too confusing. I'll think about it.

PROBLEM:

As I am playing with your SW more, or better said learning the SunFlow script with it I have noticed you probably not integrated it right or at least I am doing something wrong because in the SunFlow manual PDF on page 97 "Trace Depth" there seems to be a solution for the problem some of the users here had dealing with too dark trans part. But when I add that piece of code to the BlueRender (into Setup tab which should act as "the scene file") nothing happens, everything is still the same...could you, please, look at it? :look:

Ok first, to clarify, this is how Bluerender works: it loads the 3 scripts at startup, and then it uses the buffers in the tabs, not reading the files anymore. So if you changed the files instead of the buffers, while the program was running, the changes would have not picked up.

Then the three scripts are joined to obtain a single script (there's actually no difference between the tabs, you could move things from the light to the material or setup and it would work. It's just a convenience), which is the Sunflow scene.

Third, for some reason there are inconsistencies between the pdf and the actual code. I found out some days ago while working on textures (it looks like the code is more advanced). So maybe this is one of them. What code did you add? The "options::options" block doesn't work, but this one should:

trace-depths {  
 diff 1 
 refl 4 
 refr 4 
}

Try putting it in the setup script and play with the parameters as shown in the pdf (the bottle examples).

This is the class that does the parsing. If you can read some java code, it's not hard to see the grammar.

Let me know!

Share this post


Link to post
Share on other sites

you mean replacing the code %LDDCAMERA% with its substitution? That would mean that the next time you render there would be no substitution, as there is no code (it works by simple string substitution). I could instead output the replaced string somewhere so users can see that.

No, a bit the other way around like this: I am suggesting the %LDDCAMERA% is variable and that it did not came directly from LDD so it is you who have defined it somewhere inside you sw code, right? Sooo, all I am telling is like: please, if the logic of the code itself allows it (that is if you do not need this definition elsewhere in the script before the Setup.txt so you can move its deffinition) move the definition of the variable to the Setup.txt so we can learn something how did you get those coordinates, from which values so we could use them ourselfes with our own SunFlow scripts in your BlueRender, for example this is just a fictional code how it would look in .pov from POVRAY:

#declare LDDCAMERA = (something/anything * abc+efg)+blablabla;

You see? Now we know from what values you get the final LDDCAMERA result so we can for example use just a part of the values to use it elsewhere in some another meaning... :wink:

I guess i could, but i'm afraid it would be too confusing. I'll think about it.

Confusing??? In what? :look: I am working this way with ldd2povray absolutely without any confusion so I can have individual settings for any of them without perpetual rewriting of the main default files in the sw folder and this way I can render in those settings anytime later even tho I left the default ones for my other .lxfs: do I have my files in the .lxf folder? Then the settings are taken from there. Did not I have any there? Then the settings are taken from default BlueRender folder...easy as that, isn't it? :wink:

Ok first, to clarify, this is how Bluerender works: it loads the 3 scripts at startup, and then it uses the buffers in the tabs, not reading the files anymore. So if you changed the files instead of the buffers, while the program was running, the changes would have not picked up.

Quite easy solution I guess: when starting your sw there would be no or just the default values from the files in your sw folder, once the input .lxf file is selected JUST REREAD THE VALUES from the .lxf folder if they are there...also: why do you need to visualy showing the loaded files when one know he can simply edit them directly in the .txt itself? That way - no visual .txt representation inside BR GUI - would save you some bits of code and also possible probs implementing what I am suggesting.

Then the three scripts are joined to obtain a single script (there's actually no difference between the tabs, you could move things from the light to the material or setup and it would work. It's just a convenience), which is the Sunflow scene.

Yes, I know that, it is basically a form of #include in a way...you see this is what I think is confusing, you do not need 3 files, it is unnecessary, just move them all into one Setup.txt tho probably better would be Scene.sc to stick to SunFlow naming. :wink:

Third, for some reason there are inconsistencies between the pdf and the actual code. I found out some days ago while working on textures (it looks like the code is more advanced). So maybe this is one of them. What code did you add? The "options::options" block doesn't work, but this one should:

trace-depths {
diff 1
refl 4
refr 4
}

Try putting it in the setup script and play with the parameters as shown in the pdf (the bottle examples).

This is the class that does the parsing. If you can read some java code, it's not hard to see the grammar.

Let me know!

Yes, that was the code I was using that does not worked...OK, I will try your code now + thanx for the link, gonna look...

EDIT:

BTW I have worked for 10+ years as a professional FLASH ActioScript2 developer which is basically a customized JS and now as a PHP/JS/XML webdesigner freelancer, so there sgould not be much problem for me understanding JAVA, we will see...fingers crossed :grin:

Edited by bublible

Share this post


Link to post
Share on other sites

The good of Bluerender is fast trans part render speed. Many trans tile buit sails @2K res took only 8.x min. If render this model with Povray it will take forever. So we can use Bluerender to render cheese slope mosaic pattern. Almost only one factor of render time is quantity of pixels.

18346474081_fd967ace86_b.jpgsail.lxf by Nachapon S., on Flickr

18158156799_652d122f9b_b.jpgLDD Trans tile buit sails _2K res 8.x min render by Nachapon S., on Flickr

Edited by bbqqq

Share this post


Link to post
Share on other sites

The good of Bluerender is fast trans part render speed. Many trans tile buit sails @2K res took only 8.x min. If render this with Povray it will take forever. So we can use Bluerender to render cheese slope mosaic pattern. Almost only one factor of render time is quantity of pixels.

sail.lxf by Nachapon S., on Flickr

LDD Trans tile buit sails _2K res 8.x min render by Nachapon S., on Flickr

Yes and not only that: look at the level of detail...as you said in POVRAY we had to set Final radiosity to achieve it and that would take literally DAYS (I am still rendering one such MOC at the moment nonstop for the 4th day and it still is only at 66% tho the output size is small 640x360)

Share this post


Link to post
Share on other sites

Yes and not only that: look at the level of detail...as you said in POVRAY we had to set Final radiosity to achieve it and that would take literally DAYS (I am still rendering one such MOC at the moment nonstop for the 4th day and it still is only at 66% tho the output size is small 640x360)

Well, I do find Pov-Ray's renders of a higher quality (if everything is setup right).

Still, this renderer is probably better when you look at quality/performance ratio :tongue:

Share this post


Link to post
Share on other sites

So that said we "only" had to manage implementing these and we would have perfect quick and quality replacement for the POVRAY right away:

  • logo-on-stud (could be achieved in some similar way as the changeable decors part below)
  • decorations (msx80 said he is implementing this right now...SUPER!)
  • changeable decors (inspired by @hrontos' ldd2povray codes it could be done quite easily again I guess, it'd be better if he alone would enlighten us but I can describe it as I understand it if there is need...basicaly a line in the Setup.txt for the respective decor calling the replacement function - it replaces the path for every instance of the specific decor, and voila that's it ) :wink:
  • custom decors via trans polygons (so we can decor ANY BRICK WE WANT - I successfully made this for the POVRAY and I guess it can be also done for the BlueRender, SunFlow respectively...I just need access to bricks matrix values)

Well, I do find Pov-Ray's renders of a higher quality (if everything is setup right).

Still, this renderer is probably better when you look at quality/performance ratio :tongue:

Sure but we are talking about the Quality/Time ratio I guess and comapred to that THAT IS A HUUUUGE DIFFERENCE :grin:

+ to me it handles trans part much more realistically than POVRAY, like trans dark blue: in reality their edges are darker than the rest of the material but in the POVRAY they are lighter instead which is wrong of course (I managed to achieve that in POVRAY but I had to sacrifice some stuff to achieve that :sceptic: ), SunFlow handles this perfectly

Edited by bublible

Share this post


Link to post
Share on other sites

Sure but we are talking about the Quality/Time ratio I guess and comapred to that THAT IS A HUUUUGE DIFFERENCE :grin:

+ to me it handles trans part much more realistically than POVRAY, like trans dark blue: in reality their edges are darker than the rest of the material but in the POVRAY they are lighter instead which is wrong of course (I managed to achieve that in POVRAY but I had to sacrifice some stuff to achieve that :sceptic: ), SunFlow handles this perfectly

Oops. I meant quality/time ratio. :blush:

While I was typing the message, in my head I was thinking about quality/performance ratio, but then I also realized (in my head) that it had to be quality/time ratio. However, I still typed the wrong one :grin:

Share this post


Link to post
Share on other sites

Oops. I meant quality/time ratio. :blush:

While I was typing the message, in my head I was thinking about quality/performance ratio, but then I also realized (in my head) that it had to be quality/time ratio. However, I still typed the wrong one :grin:

Nevermind, I guess we understood each other this time, legolijntje :wink::laugh:

Share this post


Link to post
Share on other sites

trace-depths {
diff 1
refl 4
refr 4
}

According to that PDF there is also one another attribute called "trans" which default value is 10, but whenever I try to use that with whatever value the result is completely black picture, why? :look::sceptic:

trace-depths
{
   diff 1
   refl 4
   refr 4
   trans 10
}

...and also absorption.distance for a glass shader seems not working: if I use it in Materials tab with any value (you see still upon the PDF example: page 96) there is no object rendered on the scene - do I something wrong here? :look:

# trans dark blue
shader
{
   name mat43
   type glass
   eta 1.6
   color ("sRGB nonlinear" 0.73... 0.85... 0.9)
   absorption.distance 1.0
}

Edited by bublible

Share this post


Link to post
Share on other sites

msx80, can you create a "Bluerender Lego renderings"(for example) flickr group?

Good idea! I've created it, it's here! Add as many picture as you like!

Later i'll read and reply to all other messages, thanks everybody for your interest and partecipation! :)

Share this post


Link to post
Share on other sites

No, a bit the other way around like this: I am suggesting the %LDDCAMERA% is variable and that it did not came directly from LDD so it is you who have defined it somewhere inside you sw code, right? Sooo, all I am telling is like: please, if the logic of the code itself allows it (that is if you do not need this definition elsewhere in the script before the Setup.txt so you can move its deffinition) move the definition of the variable to the Setup.txt so we can learn something how did you get those coordinates, from which values so we could use them ourselfes with our own SunFlow scripts in your BlueRender, for example this is just a fictional code how it would look in .pov from POVRAY:

#declare LDDCAMERA = (something/anything * abc+efg)+blablabla;

You see? Now we know from what values you get the final LDDCAMERA result so we can for example use just a part of the values to use it elsewhere in some another meaning... :wink:

The fact is that i don't know that value. The value is extracted from the LXF file, so it is dynamic. 99% of the time you want to use the LDD camera. If you want to use another setting for the camera, you can already do that (there's a commented-out example in setup.txt). I could only show how it's translated

why do you need to visualy showing the loaded files when one know he can simply edit them directly in the .txt itself? That way - no visual .txt representation inside BR GUI - would save you some bits of code and also possible probs implementing what I am suggesting.

Indeed i don't need to show them and to have them separated :P i guess it was clearer, but maybe you're right

Share this post


Link to post
Share on other sites

Thank you very much for this new program! I did some tests and I'm really counting on its further development!

But to be honest, it's not that faster than POV-Ray than it seems at first. With only LDD geometry, a single light source and a simpler radiosity like OutdoorLQ you'll get your render just as fast in POV-Ray and with pretty much equal quality.

Also I had some trouble with setting my image size. I wanted it to be 1920*1024 and (since the ratio is different from the default) my picture looked distorted. In LDD2POV-Ray I never thought this was possible, I could have some parts of a model cropped, but never a distorted image. Also with a huge size of rendering image my preview window only shows it's middle part and there's no way to see the whole picture. Am I doing something wrong?

Share this post


Link to post
Share on other sites

So that said we "only" had to manage implementing these and we would have perfect quick and quality replacement for the POVRAY right away:

  • logo-on-stud (could be achieved in some similar way as the changeable decors part below)
  • decorations (msx80 said he is implementing this right now...SUPER!)
  • changeable decors (inspired by @hrontos' ldd2povray codes it could be done quite easily again I guess, it'd be better if he alone would enlighten us but I can describe it as I understand it if there is need...basicaly a line in the Setup.txt for the respective decor calling the replacement function - it replaces the path for every instance of the specific decor, and voila that's it ) :wink:
  • custom decors via trans polygons (so we can decor ANY BRICK WE WANT - I successfully made this for the POVRAY and I guess it can be also done for the BlueRender, SunFlow respectively...I just need access to bricks matrix values)

That sounds like a huge amount of work you set up for me :) Decorations is mostly working, i think i'll release it soon, changeable decors also are quite easy, but I don't know how i'll implement the UI for replacement yet.

About the other stuff i don't have plans to realize them honestly :) Well custom decors via tras polygons will not be necessary i think: you'll be able to choose a decor for all pieces that have texture UV mapping, which is a lot (most of them are not usable in LDD becouse they have no prints available).

Thank you very much for this new program! I did some tests and I'm really counting on its further development!

But to be honest, it's not that faster than POV-Ray than it seems at first. With only LDD geometry, a single light source and a simpler radiosity like OutdoorLQ you'll get your render just as fast in POV-Ray and with pretty much equal quality.

Also I had some trouble with setting my image size. I wanted it to be 1920*1024 and (since the ratio is different from the default) my picture looked distorted. In LDD2POV-Ray I never thought this was possible, I could have some parts of a model cropped, but never a distorted image. Also with a huge size of rendering image my preview window only shows it's middle part and there's no way to see the whole picture. Am I doing something wrong?

As for the distortion: you have to adjust the "aspect" value manually in the Setup tab (1.875 in your case). I'll automate that in the next version :)

About speed, you're right, povray can be customized to be quite fast too (i'm not really an expert on the software tho, so i can't speak about how fast or how much quality). As i said i'm not trying to compete with it :) This program started as a simple experiment with sunflow.

According to that PDF there is also one another attribute called "trans" which default value is 10, but whenever I try to use that with whatever value the result is completely black picture, why? :look::sceptic:

trace-depths
{
diff 1
refl 4
refr 4
trans 10
}

It's not in the code. It just reads diff, refl and refr (diffuse, reflection, refraction). It appears black probably becouse when there's something wrong it drops the shaders and render without any shader. Probably there's some error tracing in the console window.

...and also absorption.distance for a glass shader seems not working: if I use it in Materials tab with any value (you see still upon the PDF example: page 96) there is no object rendered on the scene - do I something wrong here? :look:

# trans dark blue
shader
{
name mat43
type glass
eta 1.6
color ("sRGB nonlinear" 0.73... 0.85... 0.9)
absorption.distance 1.0

}

The code looks right, absorption.distance is accepted and should be right after color, just like you did. Try and look in the console window for errors.

Share this post


Link to post
Share on other sites

That sounds like a huge amount of work you set up for me :) Decorations is mostly working, i think i'll release it soon, changeable decors also are quite easy, but I don't know how i'll implement the UI for replacement yet.

You do not need to do any GUI for it, simple textual COPY/PASTE inside Setup.txt (tho I rather see it named scene.sc), very easy: youjust show users one simple HOW TO and thats it...it would be one line, like:

/* basically a copy of @hrontos' elegant solution to this "problem" */
ChangeDecor(88074, "C:\somePathToMyDecors\someDecorOfMine.png");

About the other stuff i don't have plans to realize them honestly :) Well custom decors via tras polygons will not be necessary i think: you'll be able to choose a decor for all pieces that have texture UV mapping, which is a lot (most of them are not usable in LDD becouse they have no prints available).

:laugh: Do not worry about it, that was mostly for myself: normaly you can only place decors on bricks that supports it in LDD, this way around - my own solution - I do not need to care about it, I just decor whatever I want, you see now? :wink: If you would like to implement it too just tell me... :sweet:

But for that reason I would like to have...ehm, I would like to ask you :sweet: for two simple things:

  • (maybe you already doing this, I do not know, anyway) put all the bricks into one multidimensional associative array where first element would be the respective brick having all attributes that comes with it from the .lxf, so one could access it like

bricksArray[9].name;
bricksArray[9].color;
bricksArray[9].matrix;
...etc.

...so this way I can easily find the brick I want by the name/color combination using the .log file below
:grin:
  • please make .log output from the cmd window when you importing the bricks or even better output .log of the bricks array

Just to show you "reason" I have for this:

techtronersemtteam.jpg

See the boxes decors from the 4 sides, without my solution this could not be done in any way...and as I am developer of my own pseudo subtheme Techtroners I just need this things badly. :sceptic::look:

Anyway of course BlueRender do not need this at all, it is just we want to make it really the best tool ever, right? :laugh::grin:

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.