msx80

[Software] Bluerender, a rendering engine for LDD

Recommended Posts

Glad to hear your experience was explosion free :) About the error, yes you could send me the problematic lxf and i'll give it a go in debug. But first try this: i noticed that some similar errors happened to me with very old lxf files (made with old version of LDD). The solution was opening them with (current) LDD and re-saving. Some times it corrected the issue. Might help if this is your case too.

The files weren't that old, but resaving it did seem to fix the problem the renderer had. That makes two problems like that so far (model sunk into the plane was the first). So what is your philosophy on how much effort should be put into compensating for "flaws" in LDD (assuming you had the time to do something about it anyway, we are talking hypothetically now)? Is the right answer always, "Try resaving your LXF file"? Just curious.

About speed: is it in the proper rendering or in the "loading" phase (before opening the image window)? The rendering should be exacly the same. The loading maybe slowed a bit but i'm working on it right now. I'm switching to parallel loading, should use all the core and be about twice as fast (which will go into blueprint too!)

Yes, the loading phase. Not sure why linear loading became significantly slower between v1 and v2, but parallelism should help.

I find myself doing multiple renders in a row of the same model while fiddling with the scene parameters, and yet each time I render it re-reads the model geometry and parts. It really does seem to me that the best approach would be to process the LXF file just once and cache that data for reuse if the LXF file has not changed. (I am assuming here that the loading phase doesn't apply the scene data at the same time. If it did, the two processes would have to be separated for that to work.)

Edited by iceleftd

Share this post


Link to post
Share on other sites

Uhm i'm pretty sure you don't have an exact idea of how shadows work in a raytracer :P Or how complex the code behind it is :)

I'm sorry but i'm not picking up the development of sunflow. I did the minimal on texture alpha support just becouse it was necessary and becouse it was a clean operation, but i'm not

Indeed, as you may know I am not Java programmer, I am Adobe FLASH AS2 mainly so this was just hypothetical hoping you will understand that I was trying to be as much helpful as possible having thought you understand it and just change it to suit your needs...nevermind

BTW: I think even with the most complicated piece of code many times it needs just one "final" line that simply strips concrete object from the processing, like there have to be some point where the code apply some other part of functions/code that actually make shadows etc. so I thought simple "if" would be enough to tell the code to avoid respective objects...ah, whatever.

I'm sorry but i'm not picking up the development of sunflow. I did the minimal on texture alpha support just becouse it was necessary and becouse it was a clean operation, but i'm not expanding it :) I might make some tests on texturized glass but that's all, i don't promise any result :) Sorry to disappoint you!

OK, would be great if the texturized glass part work

I find myself doing multiple renders in a row of the same model while fiddling with the scene parameters, and yet each time I render it re-reads the model geometry and parts. It really does seem to me that the best approach would be to process the LXF file just once and cache that data for reuse if the LXF file has not changed. (I am assuming here that the loading phase doesn't apply the scene data at the same time. If it did, the two processes would have to be separated for that to work.)

I do not agree: many times I change something in the respective .lxf and if it would not reread it everytime then it would not render the last version, like with the .lxf still selected in BR I open LDD, do some modifications, save and then hit Render on BR.

Edited by bublible

Share this post


Link to post
Share on other sites

The files weren't that old, but resaving it did seem to fix the problem the renderer had. That makes two problems like that so far (model sunk into the plane was the first). So what is your philosophy on how much effort should be put into compensating for "flaws" in LDD (assuming you had the time to do something about it anyway, we are talking hypothetically now)? Is the right answer always, "Try resaving your LXF file"? Just curious.

Well it depends on the specific problem.. The plane adjustement is clearly something that my program should support, while i'd rather skip on the error on loading older files, at least if it doesn't appear on new ones. If you want to spend some time, you could compare the difference in the old file and the newly saved one to see if something jumps to the eye... Most probably it's a problem in the decoration/material stuff. Pinpointing the problem will surely help :)

I plan to keep correcting and improving both blueprint and bluerender, the time to spare is always too little so it will take a while.. I already have dozens of issues open on both programs, i'm slowly marking them down :) I considered using some public issue tracker and moving all stuff there but haven't done it yet.

Yes, the loading phase. Not sure why linear loading became significantly slower between v1 and v2, but parallelism should help.

I find myself doing multiple renders in a row of the same model while fiddling with the scene parameters, and yet each time I render it re-reads the model geometry and parts. It really does seem to me that the best approach would be to process the LXF file just once and cache that data for reuse if the LXF file has not changed. (I am assuming here that the loading phase doesn't apply the scene data at the same time. If it did, the two processes would have to be separated for that to work.)

Are you perhaps able to tell the exact phase that got slower? Like the text in the "activity" box?

About loading: the loading phase has many steps: first it loads the model in a generic datastructure, the same that is used by blueprint. This phase also loads the single bricks geometry (and should be much faster in the new "parallelized" version). Then the scene.sc file is read and processed (substitutions etc). Then the geometries (that are Sunflow objects) are generated (one for each design id) into a text buffer, and then the instances (one for each brick in the model). After that the three portion are joined into a single text and fed to sunflow. So yes, i could skip reparsing of the LXF quite easily, checking if the lxf has not changed and keeping the buffers in memory. I have to check for memory issues (keeping giant buffers consumes ram) but should be doable!

Indeed, as you may know I am not Java programmer, I am Adobe FLASH AS2 mainly so this was just hypothetical hoping you will understand that I was trying to be as much helpful as possible having thought you understand it and just change it to suit your needs...nevermind

BTW: I think even with the most complicated piece of code many times it needs just one "final" line that simply strips concrete object from the processing, like there have to be some point where the code apply some other part of functions/code that actually make shadows etc. so I thought simple "if" would be enough to tell the code to avoid respective objects...ah, whatever.

Didn't meant to be rude, in case it wasn't clear :) I appreciate your inputs, as you saw some of them are already in bluerender :)

I do not agree: many times I change something in the respective .lxf and if it would not reread it everytime then it would not render the last version, like with the .lxf still selected in BR I open LDD, do some modifications, save and then hit Render on BR.

Well if i do that i'll surely put a check to see if the lxf was modified (checking the timestamp), in which case i'd force the reloading.

Share this post


Link to post
Share on other sites

I do not agree: many times I change something in the respective .lxf and if it would not reread it everytime then it would not render the last version, like with the .lxf still selected in BR I open LDD, do some modifications, save and then hit Render on BR.

My original post with that suggestion included the fact that the cache would be purged if the LXF file path or timestamp was changed so that wouldn't be a problem. Sorry I didn't repeat that the second time.

Share this post


Link to post
Share on other sites

My original post with that suggestion included the fact that the cache would be purged if the LXF file path or timestamp was changed so that wouldn't be a problem. Sorry I didn't repeat that the second time.

OK, then I agree :thumbup:

Share this post


Link to post
Share on other sites

ok dumb question, is there an installer for this? I can't seem to find one. I downloaded the v2 stuff but nothing there...am I missing something?

Cheers

Jody

Share this post


Link to post
Share on other sites

ok dumb question, is there an installer for this? I can't seem to find one. I downloaded the v2 stuff but nothing there...am I missing something?

Not a dumb question. This is not an installed program. You simply unzip the files into a directory, navigate into it and click on the .BAT file to start the program. You must already have LDD installed (to get the parts library) and have Java 8 installed (preferably the 64-bit version). That's it!

Edited by iceleftd

Share this post


Link to post
Share on other sites

Maybe I'm missing something, but don't seem to be able to avoid an explosion-free experience.

AQNQgZb.png

hBLtH37.png

If I click the batch file, I get the command prompt error. If I use the Java executable in the bin folder, I can get the program to run, but something will go horribly if I try to render anything.

Share this post


Link to post
Share on other sites

If I click the batch file, I get the command prompt error. If I use the Java executable in the bin folder, I can get the program to run, but something will go horribly if I try to render anything.

Your command window output indicates that the java/bin folder is not in your default path. That is very odd as that normally is set when you install Java. Try creating a command window and issuing the command:

c:\>echo %PATH%

In the output you should see a string for the Java bin folder. If not, you should probably reinstall Java.

Share this post


Link to post
Share on other sites

Your command window output indicates that the java/bin folder is not in your default path. That is very odd as that normally is set when you install Java. Try creating a command window and issuing the command:

c:\>echo %PATH%

In the output you should see a string for the Java bin folder. If not, you should probably reinstall Java.

I guess he should reinstal it right away as it looks like broken JAVA instalation. If you are on Windows, after uninstaling also restart your machine and only then instal your JAVA again, like:

  1. uninstal JAVA
  2. restart your PC
  3. instal JAVA

Edited by bublible

Share this post


Link to post
Share on other sites

As i've some things ready, I've prepared a small surprise new version :P It has the following changes:

  • Model loading is fast again (even faster!)
  • Some textured glass support (not perfect yet)
  • Clickable scene label (opens the scene file)
  • Self adjusting plane height
  • Search file in db folder beside db.lif
  • Bugfixes

You can get it here. If anyone wants to give a quick test before i update the main page, it would be great!

Share this post


Link to post
Share on other sites

As i've some things ready, I've prepared a small surprise new version :P It has the following changes:

  • Model loading is fast again (even faster!)
  • Some textured glass support (not perfect yet)
  • Clickable scene label (opens the scene file)
  • Self adjusting plane height
  • Search file in db folder beside db.lif
  • Bugfixes

You can get it here. If anyone wants to give a quick test before i update the main page, it would be great!

Sure, gonna do that right away... :wink::thumbup:

Model loading is fast again (even faster!)

Works...fast as hell again! :thumbup:

Some textured glass support (not perfect yet)

Works...SUPER! (ah, just only if I could change your mind implementing those at least 2 new attributes for objects "noshadow" and "noreflections" as my transparent object still casting those... :sceptic::tongue: ) :thumbup:

Clickable scene label (opens the scene file)

DOES NOT WORK - if one sets to open .sc differently in the OS (it is needed more to be autoopen in editor than in renderer)

Search file in db folder beside db.lif

DOES NOT WORK - NullPointerException...seems like your path to db folder is wrong so it cannot find the .png in it :sceptic:

Edited by bublible

Share this post


Link to post
Share on other sites

DOES NOT WORK - NullPointerException...seems like your path to db folder is wrong so it cannot find the .png in it :sceptic:

Uhm that's strange, can you paste the complete error?

What circumstances causes the NullPointer, exacly? Like, you loaded a lxf with a decoration present in the db folder?

Share this post


Link to post
Share on other sites

Hi,

this looks quite impressive. I am on holiday atm and can't test this out on my PC. A quick question: would it be possible in theory to export LDD models into another format using the LDD geometry for rendering LDD sets in another 3d app? I have a workflow by using an OGL capture tool what works fine but needs some manual steps.

A great format beside .obj would Collada supporting instances sorted by geometry and optionally by geometry and color to keep the scene files small for complex models.

Share this post


Link to post
Share on other sites

SUGGESTION:

Please, add one option in the GUI (check field) with "Do not show confirmation window/auto-rewrite" cos it starting to be a drag continualy clicking on that one everytime I do new render (and I do several in a row quite quickly)...ehm, could you? :grin:

Uhm that's strange, can you paste the complete error?

What circumstances causes the NullPointer, exacly? Like, you loaded a lxf with a decoration present in the db folder?

:sweet: I am suggesting to continue this over PM as this is not allowed public discussion here

Edited by bublible

Share this post


Link to post
Share on other sites
Search file in db folder beside db.lif

Works now...thanx! :thumbup:

Edited by bublible

Share this post


Link to post
Share on other sites

As i've some things ready, I've prepared a small surprise new version :P It has the following changes:

  • Model loading is fast again (even faster!)
  • Some textured glass support (not perfect yet)
  • Clickable scene label (opens the scene file)
  • Self adjusting plane height
  • Search file in db folder beside db.lif
  • Bugfixes

You can get it here. If anyone wants to give a quick test before i update the main page, it would be great!

Well done! I don't have a sunken model to test anymore but thanks for automating that fix for us. Loading is very quick again as you say.

I've been looking at images to identify what I don't like and see if I can figure out how to change the scene file to fix them (sometimes stumbling in the dark).

I noticed that the shaders for the chrome colors are incorrect. They should be replaced with something like this:

shader {
name mat309
type mirror
refl 0.80784315 0.80784315 0.80784315
}
shader {
name mat310
type mirror
refl 0.8745098 0.75686276 0.4627451
}

But that pointed out another problem. Chrome parts reflect the sky (ceiling) too, but the sky appears to be black.

17872617943_46d43d6755_c.jpgBluerender Chrome test by iceleftd, on Flickr

Now I guess that makes sense because there is no "sky" object/plane above, but this looks pretty awful. I tried fiddling with some solutions but nothing worked for me. Ideas anyone?

Edited by iceleftd

Share this post


Link to post
Share on other sites

Well done! I don't have a sunken model to test anymore but thanks for automating that fix for us. Loading is very quick again as you say.

I've been looking at images to identify what I don't like and see if I can figure out how to change the scene file to fix them (sometimes stumbling in the dark).

I noticed that the shaders for the chrome colors are incorrect. They should be replaced with something like this:

shader {
name mat309
type mirror
refl 0.80784315 0.80784315 0.80784315
}
shader {
name mat310
type mirror
refl 0.8745098 0.75686276 0.4627451
}

But that pointed out another problem. Chrome parts reflect the sky (ceiling) too, but the sky appears to be black.

Bluerender Chrome test by iceleftd, on Flickr

Now I guess that makes sense because there is no "sky" object/plane above, but this looks pretty awful. I tried fiddling with some solutions but nothing worked for me. Ideas anyone?

Why are you so antagonistic to having the sky up there and instead trying to come up with some other solution in the first place? :look:

Anyway, you could make biiig biiig mesh or plane above your normal plane, lets say on y=50, give it a color and there you go... :wink:

...or use IBL light with HDR imagery (you can find some that are not showing sky, like some interier)

Edited by bublible

Share this post


Link to post
Share on other sites

PROBLEMS:

janino shader(s) - giving an error that the shader is trying to import something that was already imported once (org.sunflow.core.K) but when I look at the specific code there is no such import request in the Fresnel code (that is the actual janimo shader I am trying to test, PDF p.28)

SUGGESTIONS:

clickable .sc link - could you make the .cs info text clickable so that when one clicks it it opens the file for editing? :wink:

Share this post


Link to post
Share on other sites

By comparison, here is the same model rendered with POV-Ray - default settings, quality 8 (lowest with reflection). Note there is a reflection of a diffuse sky.

17876267353_a7bb618323_c.jpgPOV-Ray reflection comparison by iceleftd, on Flickr

Why are you so antagonistic to having the sky up there and instead trying to come up with some other solution in the first place? :look:

Anyway, you could make biiig biiig mesh or plane above your normal plane, lets say on y=50, give it a color and there you go... :wink:

...or use IBL light with HDR imagery (you can find some that are not showing sky, like some interier)

I did try putting up a plane but it blocked the sunsky light - not what I had in mind. Maybe putting a plane high enough might work. I haven't figured out how to get IBL/HDR to work yet... :P

I did find this online:

There isn't a setting in the syntax that controls sun intensity, but you can instead control the suns direction in terms of angle to the object. So if the Sunsky direction is at a near 0 degree angle with the object (the sun on the horizon) it will be dark and the sky will be more a sunset color. If the direction is more high in the sky at around 80 degrees it will be bright with the sky being white/blue. Changing the up and east values can also change the look, but these are more used to change how the Sunsky is interpreted in different world spaces which might be required in different applications. The up and east values in the above example usually work for everyone. The Sunsky light has a set horizon where the sky stops and the blackness of the world shows up. Normally an infinite plane is the work-around. Future versions of Sunflow might have a control to extend the sky, but you can also modify the source and compile Sunflow yourself so the sky extends on its own. In src.org.sunflow.core.light.SunSkyLight.java go to the line that says groundExtendSky = false; Change it to groundExtendSky = true; Compile Sunflow and the sky will no longer terminate at the horizon.

Looking at the source code online it looks like the code doesn't need modification, and that the scene file should support "ground.extendsky true" after "samples" but it doesn't like that syntax. That support was added in April 2007 so I can't imagine this doesn't support it. Any ideas?

Edited by iceleftd

Share this post


Link to post
Share on other sites

PROBLEMS:

sss shader - when used all I get is completely black image :sceptic:

UPDATE:

So I tested ALL JANINO SHADERS that are there in the PDF and with every single ona of them there is exactly the same problem as I stated in the post above... :look:

I haven't figured out how to get IBL/HDR to work yet... :P

I posted IBL HOW-TO in this thread, go back and find it :wink:

Looking at the source code online it looks like the code doesn't need modification, and that the scene file should support "ground.extendsky true" after "samples" but it doesn't like that syntax. That support was added in April 2007 so I can't imagine this doesn't support it. Any ideas?

To be honest with you I am still not quite sure what are you trying to achieve exactly :grin:

BTW did you try this:

background{ color 1 1 1 }

It has "lightening" effects on objects (for example trans dark blue without this just with the sun light looks almost like black dull mirror)

Share this post


Link to post
Share on other sites

SUGGESTIONS:

clickable .sc link - could you make the .cs info text clickable so that when one clicks it it opens the file for editing? :wink:

Haha, Gee, it actualy already do exactly this, sorry (well, at least that means that we think quite similarily) :laugh::grin::thumbup:

BTW is that org.sunflow.core.K your own added class? Cos when I search for it at SunFlow GITHUB I cannot find it? :look:

Share this post


Link to post
Share on other sites

Well done! I don't have a sunken model to test anymore but thanks for automating that fix for us. Loading is very quick again as you say.

I've been looking at images to identify what I don't like and see if I can figure out how to change the scene file to fix them (sometimes stumbling in the dark).

I noticed that the shaders for the chrome colors are incorrect. They should be replaced with something like this:

shader {
name mat309
type mirror
refl 0.80784315 0.80784315 0.80784315
}
shader {
name mat310
type mirror
refl 0.8745098 0.75686276 0.4627451
}

But that pointed out another problem. Chrome parts reflect the sky (ceiling) too, but the sky appears to be black.

17872617943_46d43d6755_c.jpgBluerender Chrome test by iceleftd, on Flickr

Now I guess that makes sense because there is no "sky" object/plane above, but this looks pretty awful. I tried fiddling with some solutions but nothing worked for me. Ideas anyone?

Well it's surely better than the setting i have now! They look a little too shiny tho, maybe darkening a little? Anyway when we found a satisfying setting i'll include it in the standard scene.sc. About the black, i don't know. The only thing that comes to mind is the one bublible said, have you set a background color different from black? Maybe you could look into official Sunflow and its example if there's something. It's also possible that my tampering of sunflow sources introduced the problem, even if i don't think so

Haha, Gee, it actualy already do exactly this, sorry (well, at least that means that we think quite similarily) :laugh::grin::thumbup:

BTW is that org.sunflow.core.K your own added class? Cos when I search for it at SunFlow GITHUB I cannot find it? :look:

Yeah indeed, that's what the clickable label was about :)

Actually i think the reason why the janino shaders don't work is becouse i obfuscated the sources, and sunflow sources got caught in the process. (obfuscation means changing all the class names and methods with unreadable one letter names to impede decompilation, a standard practice to protect source code) Eventually in the next release i'll fix it and make sunflow into his own jar library. About SSS shaders, i don't even know what they are :)

Edited by msx80

Share this post


Link to post
Share on other sites

Yeah indeed, that's what the clickable label was about :)

Yea, firstly I understnad it in another way (like one can click .sc in Windows Explorer and it opens/runs/starts your SW :grin: )

Actually i think the reason why the janino shaders don't work is becouse i obfuscated the sources, and sunflow sources got caught in the process. (obfuscation means changing all the class names and methods with unreadable one letter names to impede decompilation, a standard practice to protect source code) Eventually in the next release i'll fix it and make sunflow into his own jar library. About SSS shaders, i don't even know what they are :)

I was asking cos those janimo stuff looks like they could be "it" for me: instead of digging into the JAVA rabbit whole completelly I could just play with those bits of JAVA codes janino actually uses, besides I too do not know all of them (like what some of them actually do) BUT some of them seems to contain bits of code that actually do kind of gradient (if I understood it right) and shader mixing therefore it would be great if you would do something that would enable those jamino shaders actualy work :wink:

BTW probably new problem: to avoid perpetual writing of the code parts I made 2 include files for my needs (my modified materials and decors), but as soon as I do that your function of changing decorations stop working tho materials works just fine (that said it cannot be that I would write the path or file in the include statement wrongly) :sceptic::look:

Share this post


Link to post
Share on other sites

That's a good idea :) i can assure janino shaders will work in bluerender, so if you want to start looking into them you could use official sunflow distribution.

BTW i'll be away next week so i'll probably won't post until next weekend :)

BTW probably new problem: to avoid perpetual writing of the code parts I made 2 include files for my needs (my modified materials and decors), but as soon as I do that your function of changing decorations stop working tho materials works just fine (that said it cannot be that I would write the path or file in the include statement wrongly) :sceptic: :look:

Probably only the main sc file is "processed" by blueprint, the others are only included but no substitution/decoration is performed. Also i think it's mandatory to have an absolute path in include file, relatives won't work

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.