Jump to content

Two requests for BabylonJS


KevinBLT
 Share

Recommended Posts

Hello everybody,

I have two requests for features. I would like to know if these were possible?

1. Hidden lines view

Would there be any possibility to create something like this:

 maxresdefault.jpg

So like defining a view point and create a flat image with only the edges visible (The faces, not the triangles) ?

Best for me would be a list of polygons and their points but a static image would be great either.

 

2. Create shadow map (and more?) with a raytracer

In our application we have a static scene most of the time. It may change every 10 seconds (if the user wants so) and the recalculation time is not a problem (could be 3+ seconds for example).

So for this case the best possible quality is more important than the fastest calculation.

 

I don't think I would be the only one who needs some like these features.

 

Thanks and have a great day!

 

Kevin

Link to comment
Share on other sites

1: EdgesRender would work with the ortigraphic camera I think but in my case it shows the triangulation? :-(

test.jpg

I think this view would be more a global camera setting than one for each object. Some 3D-Viewers have this for example with an object called: "Hidden lines".

And how is it done in blender for example? The have the views from each side just with the lines. I don't know if I describe it well enough.

 

 

2: I already use the shadow map with refresh rate 1 but I thought it would be possible to get even better results in terms of lightning (global illumination?)

 

Thank you.and have nice day!

 

Kevin

Link to comment
Share on other sites

15 minutes ago, KevinBLT said:

The have the views from each side just with the lines. I don't know if I describe it well enough

Maybe you talk about outline ? (orange line in this example http://i.imgur.com/pUcTGg2.png)

As for the hidden edges, you must write your own shader, which will take edges depending of an angle limit.

For the point 2, if you want complex lighting, you must use a dedicate render engine (vray, cycles, arnold, renderman, etc etc) and bake it into lightmaps.

Link to comment
Share on other sites

Outline would not be enough. It's like you said I need every edge depending on its angle.

I already thought this must be done via shader but I am not able to do so.

I mean this:

nissan_blueprints2.png

 

I cannot use a dedicate render endgine because the entire scene is created dynamically from cubes.

 

I think if no 3D professional adds this into Babylon I have no chance :-/

 

Thanks for you answer

 

Kevin

 

Link to comment
Share on other sites

Normally the meshes wouldn't be white and have different textures. I think I cannot merge them in this case?

Also, why is that, even the bars are triangulated? They are simple boxes?

Am  I doing something wrong?

keyDebug.registerKey("T","Test für verdeckte Kanten Ansicht",function() {
    var m = g3DScene.meshes;

    for (var i = 0, mat; i < m.length; i++) {
      if (m[i].material && m[i].material.diffuseColor) {
        mat = m[i].material;
        mat.diffuseColor.r = 1;
        mat.diffuseColor.g = 1;
        mat.diffuseColor.b = 1;
        mat.diffuseTexture = null;

        console.log(mat);
      }
      m[i].enableEdgesRendering();

      m[i].edgesWidth = 100.0;
    }

    //g3DCamera.mode = BABYLON.Camera.ORTHOGRAPHIC_CAMERA;

    g3DCamera.orthoTop = 50;
    g3DCamera.orthoBottom = -50;
    g3DCamera.orthoLeft = -50;
    g3DCamera.orthoRight = 50;

    RenderWithShadow();
  });

I use a lot of instances if this is important. 

Also is the "ArcRotateCamera" capable of being BABYLON.Camera.ORTHOGRAPHIC_CAMERA ?

I'm not able to create a sideview with it :-/

 

Thanks for help :-)

 

Kevin

Link to comment
Share on other sites

I think this would be a more difficult solution than my current one :unsure:

I don't know. I just wonder how Blender is doing this?

Unfortunately I don't have the skills to write a super fancy shader doing everything awesomely smart.

Maybe some 3D god will put in a suitable solution :rolleyes:

 

For the Edges Renderer problem I have found the problem.

Look at this thread in "Bugs" section

Thanks and best regards

 

Kevin

Link to comment
Share on other sites

I don't know i see benefits in this solution, you can have many materials as you need,
just load a texture to your mesh, its still rendered as a triangulate mesh. you can apply a texture to a simpel cube and make its looks like a car(normalmap), or football station.
switching textures with mouseclicks (car, football station,car,football station) easy and fast

Art is all about dealing with illusions.
Go for it

http://babylonjs-playground.com/#TZS2D#2

Best
Alexander

Edited by Nabroski
playground: emmi color change
Link to comment
Share on other sites

Because I would have to create these textures for a lot of objects. 

Also, many objects are created using CSG. I don't know how I would have to 

create the appropriate textures before the calculation?

This is an example of how it can look in the end:examp1.jpgAnd this is not a static object or something. You can build this 2cm bigger for example.

The balcony wood, for example, is made from CSG. 

 

But I have found out in another thread that edges renderer works for me with an additional parameter. 

So I'm getting closer. I may have to union all meshes for this view. But I am not time dependent in this moment

I am creating the print view (side and front).

 

Nevertheless, thanks for your advices! :)

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...