Posted by: KL3W - 2020-10-22, 17:23 - Forum: Help
- No Replies
Hey!
I'm new to this website, let me introduce myself. I'm KL3W_lego (@kl3w_lego on IG). I make LEGO 3D renders. I am interested by one part I found in the Parts Tracker (https://www.ldraw.org/cgi-bin/ptdetail.c...904ps0.dat), so I downloaded the .dat file and opened it in LDview. All was good. But then, as I work in Blender, I don't know how to use the .dat file. Is there a way to extract some kind of texture from a .dat file??
I've been exploring lego rendering using the LDraw system over the last few months, and it's been quite a journey. I've found several guides online from over the last ten years that have had various tips on how to get a good render using LDraw & POV-Ray. There was a lot of great info in them, but some of the advice was now out of date, and I had to spend a while comparing info between guides to get a good process.
So, now that I have a process that I'm pretty happy with, I thought I'd share it here for other's interest, and feedback is also welcome.
0. Install the LDraw AIOI package
Install whatever designers you like, and for rendering I am using LDView, the LDraw parts library, and Pov-Ray 3.7. (I am not using any of the POV-Ray alternatives such as Mega-Ray etc, as it seems POV-Ray 3.7 is newer / better than them.)
After installing that, I also install the latest version of LDView I can get, newer than what is in the LDraw AIOI at time of writing, which does change the .pov file exported, it seems to use new features of POV-Ray 3.7. I downloaded it from here: https://github.com/tcobbs/ldview/release...v4.4_Beta2
1. Generate the POV-Ray file in LDView
When LDView exports to a .pov file, it knows about high resolution part models designed for rendering, which results in a much better quality render. (It's doing this by using LGEO.xml to map to .inc part files, instead of using the standard / editor .dat part definition files).
The process to generate the pov file is to open your model file (probably an .ldr file) in LDView, then choose file menu, export...
I don't edit any of the options here, just save the file
2. Set up POV-Ray to render larger resolutions
You'll probably want to render a larger file than what POV-Ray offers by default. For one thing, the Anti-Aliasing in POVRay is not great. So, render at 2x the dimensions you want, then resize down in a program that has bicubic (or other better) resize algorithm (eg. I use the free image editor, Paint.net).
So, to do this, you need to make a one-time edit to a file that POV-Ray reads to get the render size options to offer. The file will be located at: C:\Users\[yourusername]\Documents\POV-Ray\v3.7\ini\quickres.ini
Making sure POV-Ray is closed at the time, open that file into a text editor.
If you wanted to render at 1920x1080 as you final resolution, you would want an option to render initially as 3840x2160, which you would add to the end of the file as:
[3840x2160, No AA]
Width=3840
Height=2160
Antialias=Off
Once you've added this once, save and close the file. Now this size will be available all the time in POV-Ray as a render option - which we'll get to in a minute.
3. Edit your .pov file in POV-Ray - change it to use Radiosity rendering
The default lighting provided in the .pov file from LDView has a standard 3-lights lighting setup, which casts some fairly strong shadows. I prefer to use an alternative lighting option called Radiosity rendering. To change to this I make two simple copy-paste changes at the top of .pov file, which I can do exactly the same on any file I want to render. They are:
Open the .pov file in POV-Ray first. Look at the top of the file, right below the comments, for these two lines:
4. Do a test render
The final render can take a while, even on a multi-core i7 cpu, so you want to be sure you're happy. So do a small test render to make sure its looking right.
You do this by, in POV-Ray, in the dropdown list of resolutions in the top left corner choose a small size (eg 800x600) , then press the Run icon across the top toolbar.
5. Do the final render
Once a test render looks good, time to do the final render.
To do this, go back to that dropdown list of resolutions, and look for your large size you added earlier, and choose that. Then press Run again. For a fairly simple model, the render will probably take 15 mins to an hour, depending on your hardware.
6. Resize to your final size
Open your resulting .png file in your image editing program, and resize it down 50% to your final resolution, and save.
So that's my process, I think it produces pretty nice results, with a fairly simple workflow per image. I hope someone finds it helpful. And also would be interested to hear what anyone else is doing with POV-Ray now in 2020.
I've been learning my way around rendering using LDView & POV-Ray. Along the way I've learnt about the basic/editor .dat part files, the much more detailed LGEO .inc files, and how LDView uses LGEO.xml to know when .inc part files are available, then the .dat files as a fallback in other cases. (Side note: Please let me know if I have any of that wrong!)
What I've discovered in my adventures is that the LGEO.xml file in use seems to be the one that resides in the LDView folder (C:\program files (x86)\Ldraw\LDView\), which comes with LDraw AIOI. I think in theory this should be synchronised with the .inc files available in the Ldraw parts library also installed in LDraw AIOI. However, for at least one part - 2815 technic tyre - the .inc file is in my parts library, but missing from my LGEO.xml file.
I have edited it in manually, and now my pov renders use the high resolution part.
I wonder though if I am missing something. How is LGEO.xml normally kept up to date / edited? Is there any automated tools, or official downloads that should maintain and update it?
The LDraw.org Steering Committee is pleased to announce that the 2020 James Jessiman Memorial Award (JJMA) recipient is Lasse Deleuran.
Lasse has been instrumental in bringing LDraw rendering to web browsers. His WebGL software package, buildinginstructions.js, powers the part preview on the Parts Tracker, the model viewer on the LDraw.org main site, instructions on Rebrickable, and his own site, Brickhub.org (and maybe more that I don't know about). His can do attitude, willingness to help, and passion for LDraw has helped to improve LDraw's usability and visibility. In addition to all of this, he has graciously made his code open and sharable to allow others use it in their projects.
I am new with LDCad (but not with CADD) and I am baffled with the following issue.
For some gears, when I try to rotate them so the teeth mess correctly, the hub and the teeth are "disconnected"!
For example for 32269 if I rotate it clockwise the hub will follow my rotation but the teeth will rotate counter-clockwise!
Another example for 3648b I can only rotate the hub but not the teeth.
I have tried both using the GUI rotation {R} and the entry {Ctr-r} with the same result.
I've updated the wiki to the latest Mediawiki version. Apparently, some backend stuff has been broken for some time. If you were trying to create and account or edit and encountered an error, I apologize.
In related news, the wiki.ldraw.org domain will be retired soon and the wiki moved to www.ldraw.org/wiki. I'll be doing the same thing with the forums and omr. These changes will happen as soon as I've tested and verified that nothing will break.
According to Brickset's random set browser, my next project is 4012 Wave Cops. This will require 3 new stickers (patterns for which already exist in some form), including one formed to the boat hull, and a new printed slope that appears in several police/emergency sets of that period.
For whatever reason, the official downloadable instructions for some of these late '90s sets are crystal-clear vector PDFs (as opposed to the newer ones that have raster images of not-so-good resolution). This means that I can open the PDF page in Inkscape and grab the pattern vectors directly from there:
This will give a much better resolution than any of the part photos I've seen so far—and probably better than any real copy of the part!
I had not heard of this technique being used before; has anyone got an established workflow for this process? Seems like it should be a matter of just straightening the vectors, resizing them to the slope face, importing them into—svg2ldraw, perhaps?—and probably re-triangulating. But we shall see…
I wonder if this could be done in LDRAW. really I'm mostly interested in the glass itself since it is around 16L x 8L x 6L
and would look awesome in a lego train station digital MOC assuming I can find some clever way to incorporate it with lego pieces.
Here is an idea for a possible new primitive that could be useful for plates like parts 2540, 48336, and quite a few others.
As for a name or description for such a primitive I would like some suggestions. There already exist a knob1 primitive used in minifig arms so should something else be used?
Another question I have is if the primitive should have holes where the cylinder enters it. This would possibly make 2 versions necessary, one with a hole on one side and another with holes on both [color=#333333][size=small][font=Tahoma, Verdana, Arial, sans-serif]sides.[/font][/size][/color]
[color=#333333][size=small][font=Tahoma, Verdana, Arial, sans-serif]Also the part makes use of a new 11-16disc [color=#333333][size=small][font=Tahoma, Verdana, Arial, sans-serif]primitive.[/font][/size][/color][/font][/size][/color]