KevinBLT

EdgesRenderer in WorkerThread ?

Recommended Posts

Hello everyone,

I would like to know if it was possible to do the work of "Edges Renderer" in a worker thread?

It's working really well for our projects but for some objects it can take really a lot of time in which the

scene is completely stopping to respond. 

Any suggests?

Share this post


Link to post
Share on other sites

I know. However, how would I start an implementation?

Do I absolutely need TypeScript? To do a contribution?

 

And also another question:

  Wouldn't the edgedetection be possible via shader?

Share this post


Link to post
Share on other sites

@Deltakosh : When :huh: ? exactly :D

http://www.babylonjs-playground.com/#JB4YW#1  : use flat normal material for find a edge 

http://www.babylonjs-playground.com/#JB4YW#8 : use post process and render target  for find final result

http://www.babylonjs-playground.com/#2KMG5C#5

http://www.babylonjs-playground.com/#JB4YW#11

Share this post


Link to post
Share on other sites

This is fantastic!

Can I use this with the current Babylon version?

I don't understand these exactly:

renderTarget.onBeforeRender = function () {
  for (var index = 0; index < renderTarget.renderList.length; index++) {
    renderTarget.renderList[index]._savedMaterial = renderTarget.renderList[index].material;
    renderTarget.renderList[index].material = renderTarget.renderList[index].helperMaterial;
  } 
}

renderTarget.onAfterRender = function () { 
  for (var index = 0; index < renderTarget.renderList.length; index++) {
    renderTarget.renderList[index].material = renderTarget.renderList[index]._savedMaterial;
  }
}

Why do you have to do something with private members ? Or is this just a temporary workaround?

Also, would it be possible to keep the lines the same thickness independet from the camera distance? :rolleyes:

You're really a shader god! :D 

Share this post


Link to post
Share on other sites
19 hours ago, KevinBLT said:

This is fantastic!

Can I use this with the current Babylon version?

I don't understand these exactly:


renderTarget.onBeforeRender = function () {
  for (var index = 0; index < renderTarget.renderList.length; index++) {
    renderTarget.renderList[index]._savedMaterial = renderTarget.renderList[index].material;
    renderTarget.renderList[index].material = renderTarget.renderList[index].helperMaterial;
  } 
}

renderTarget.onAfterRender = function () { 
  for (var index = 0; index < renderTarget.renderList.length; index++) {
    renderTarget.renderList[index].material = renderTarget.renderList[index]._savedMaterial;
  }
}

Why do you have to do something with private members ? Or is this just a temporary workaround?

Also, would it be possible to keep the lines the same thickness independet from the camera distance? :rolleyes:

You're really a shader god! :D 

you can use it with BABYLONX (extension) + BABYLON * notice i hope we can have it inside the babylon but it is not my job

about render target :

1. we define alternative material (in case flat normal view) for each of meshes we want 

2. define a render target 

3. push target meshes to rendertarget renderlist 

4. switch alternative material with current material before render targer wanna be render

5 switch again and put current material for next scene render after render target is finished

6 use the render target result in post process

-- 

what private exactly ? i share any source when it be ready in public

--

it is possible but you most define it in alternative material because the post process dont have access to camera and geometry information

at last thanks Kvin sorry for late i am very busy this month

but i start a topic about shader and i complete that when i find free time ( after 1 month :) )

 

 

 

Share this post


Link to post
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...

  • Recently Browsing   0 members

    No registered users viewing this page.