The problem of model texture sampling

first step : https://www.babylonjs-playground.com/#4AJ16M#80
final step : https://www.babylonjs-playground.com/#4AJ16M#82
with some effect : https://www.babylonjs-playground.com/#4AJ16M#83



image

optimized : https://www.babylonjs-playground.com/#4AJ16M#84 60fps

1 Like

ok It’s so good

https://www.babylonjs-playground.com/#4AJ16M#85
This one doesn’t seem very sharp, and there’s something wrong with the depth, right?I guess the

  • If you look at the original scene
    Wireframe

@ nasimiasl绝地大师
What part of the code you write deals with line
It’s not a very obvious line, and it’s a little jagged, so I want to fix it to make it a little bit more obvious
image
I want to achieve this effect
https://www.babylonjs-playground.com/#4AJ16M#89

it is not depend to line it is calculate with flat normal + mesh
look line 189:

result.xyz = (+BABYLONX.Normals.Flat+*0.5+0.5)*0.5+
vec3(float(+(cl1)+))*0.5;

                             result.w = 0.5;



http://www.hightopo.com/demo/Wireframe/
Can you do that? You can see it’s a very smooth line, not a bit jagged

line : 201 change var l = 0.0005; to var l = 0.00015; // line stroke
and line : 213
result.xyz =vec3(length(res)vec3(0.,0.5,0.9)+
min( 0.15 , 5.
(abs(res.x-res2.x)+abs(res.y-res2.y)+abs(res.z-res2.z))));
0.15 is line opacity

https://www.babylonjs-playground.com/#4AJ16M#91
https://www.babylonjs-playground.com/#4AJ16M#92



Sorry!I feel that this method may not achieve the desired effect. Can we use texture sampling? I feel that the scene I sent you before seems to be useful for texture sampling
https://www.babylonjs-playground.com/#4AJ16M#94

if you are worried about the lines being jagged, could always toss a smoothstep calc in there or do a couple extra passes on the shader to sample the neighbors and smooth everything out with some AA.

Another option is do your custom shader pass then add a post process to AA it.

@nasimiasl great work dude, that shader is really really close to the example! I think if ran works on it a little bit he will have winner.

Its kinda hard to understand the ShaderBuilder stuff though.

1 Like

image
Yes, he is!But what kind of line sense do I want to build on him, obviously, and the lines are smoother

@ nasimiasl绝地大师
Hey can draw lines and achieve a sense of line by computing grid??

https://www.babylonjs-playground.com/#4AJ16M#101
https://www.babylonjs-playground.com/#4AJ16M#102

:sweat_smile:this line seems a little too messy, too dense


I am looking at how this is implemented, I want to use it for reference, this is the effect implemented with threejs, I guess the effect I want, it may be surface painting, the interior should be hollow
https://www.babylonjs-playground.com/#4AJ16M#103

@ nasimiasl绝地大师
hey, can you simplify the redundant wireframe, without displaying the wireframe inside, and the color is a little more natural, like this



This section is used to create the wireframe??How should I modify it to make it easier

You should generate the wireframe entities correctly, and then draw the mesh and wireframe entities at the same time.

ThreeJs’ EdgeGeometry can be referenced, but that implementation is not particularly good.

中文:
你应该正确的生成线框实体,然后同时绘制透网格和线框实体就行了.
threejs的EdgeGeometry可以参考,但是那个实现的并不是特别好.

is because the function of threejs does not work well in BBL, so it cannot be used

I guess he is outside in the line, the inside is empty, and then add edge light, the effect should be much better

let me find you a old post about Edge Geometry
:slight_smile:
you read that

wait for you

I can’t help it