LDraw.org Discussion Forums

Full Version: OMR Model Render
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
Now that I've implemented Lasse's WebGL renderer on the PT, what is the feeling of expanding it to the OMR? Is anyone particularly attached to brigl? Why?
There is one huge advantages with brigl: It is able to render with light sources and smooth surfaces. This does wonders for realism, as opposed to the building instructions-focused cell shading. I personally find this important for proper presentation of LEGO models. This is in the pipeline for buildinginstructions.js. However. I do not know when this feature will be added as I only have 2-3 hours each evening to work on projects.

While there have been a lot of performance improvements in buildinginstructions.js, I still have to measure it against the renderer on OMR (and to be fair, also Mecabricks): Both loading time, rendering time and storage should be compared.

The optional features buildinginstructions.js brings to the table are:

  • Logos on studs
  • Optional lines (line type "5": Those around the cylinders of studs and other rounded surfaces)
  • Use IndexedDB to cache parts for quicker loading
  • In-browser Generated simple primitives for even quicker loading (stud.dat, 4-4edge.dat, etc.)

New features can of course be added - both pull requests, GitHub issues and direct messages are accepted Smile
For what it's worth, I agree the lit rendering is better on the OMR.
I am currently working on 3 improvements for the buildinginstructions.js project. One of these is more realistic rendering. 

[Image: IDarxYs.png]
As you can see, I have a lot of work ahead of me. Currently there are 3 tasks which have to be finished:

1) Proper computation of normals. In the picture above I have used the built-in normal calculation. There is another post on this forum where we discuss normals, and I will be implementing a custom normal calculation which ensures hard edges where we have lines of type 2.

2) Rendering of special materials. I am currently pretty happy with how rubber is rendered. However. Having proper rendering of chrome and metal will require both a proper environment map, and other textures. My hope is that I will end up with some really neat looking parts, but this is unfortunately a new area for me.

3) Reflections, shadows and floor should be added. There are tutorials showing how to do this with three.js and I just have to find the time to do this right... unless someone else want to take it on and create some pull requests  Wink

Thanks for all the work you have done and continue to do. I look forward to the results.
I'm the one who thanks for all the great parts and tools! This is simply my way of giving a little back.

I think I have the edges under control now:

[Image: fZvNUmL.png]
The next step will be surfaces - they have to be roughed up.
An update!

[Image: vjKiqBV.png]

You can see some artifacts on the flat yellow parts. It is by modifying these artifacts and adding "damage" to the parts that I expect to get the rendering to become more realistic. Also. I will add a pattern to the ground, different lights, and other improvements. Slow and steady Smile

EDIT. A closeup showing the level of detail up close:

[Image: uiC7QsA.png]
(2019-08-23, 12:54)Lasse Deleuran Wrote: [ -> ]An update!

Starting to look very nice.

Did you make those bevels using a shader or did you manipulate the meshes before rendering?
(2019-08-23, 19:25)Roland Melkert Wrote: [ -> ]Starting to look very nice.

Did you make those bevels using a shader or did you manipulate the meshes before rendering?

With these tenderers I am using out-of-the-box shaders as I am not too worried about performance (yet)

The smooth shading around studs, curved slopes and such is created by some heuristics I have come up with for splitting normals. It is not yet perfect, as can be seen on the macaroni brick in the lower front corner. 

The smoothened corners is done by generating textures for normal maps on the fly and again using some less-than-perfect heuristics for UV calculation. 

I will will post a write up with illustrations in the “adventures of creating a web renderer” topic once I have some more progress on the environment mapping, ground texture and lights. 

But I have to say. This is quite fun. And much more technically than I feared.
I have now added materials for the various types of colors, and it is time to test it out on brickhub.org to find errors before suggesting to use it in OMR.

It works fine for some models:

[Image: 343.png]

(Hint: The keys "QWEASD" can be used to move the lights - I am still working on proper scene controls)

While other models show that there are issues with some parts:

[Image: 476.png]

I believe the issue here is due to my custom UV generation. 

Furthermore. I would like to use normals to generate stud logos in order to preserve loading and rendering performance. As you can see, I have turned stud logos off for now since it has a major impact (hundreds of triangles per stud).
Pages: 1 2 3 4 5 6 7