BabylonJS MeshLine - a port of THREE.MeshLine

Yeah, but quite a pain in the ass to create one :stuck_out_tongue: I’ll go with

 if( gl_FragColor.a == 0. ) discard;

for now :slight_smile:

EXCELLENT news :slight_smile: I want to play with your Grease lines :slight_smile:

1 Like

HELL YEAH !!!

1 Like

@sebavan

Guys, sorry to disappoint you, I am on a one week vacation starting today, so you have to wait a bit more :see_no_evil:

However the Standard/PBR material based GreasedLines are already working with one MaterialPlugin. Dash/line length visibility/vertex offsets/color segments/widths segments/color distribution/width distribution/lazy drawing/instanced lines/… everything is tested and working.

I started to peek into the insanely pro written Decals stuff :metal: made by @Evgeni_Popov (Thank you! :beers: ) and I will borrow his ideas and adjust my code to match his approach.

@sebavan @Evgeni_Popov Guys it was a very clever idea from you to advice me to go with Std/PBR + one MaterialPlugin, I don’t have to deal with textures/opacity/uvs/etc in my custom shader. Thanks! :wink:

:vulcan_salute:

5 Likes

Amazing and no rush !!! Have a great vacation, you ll have the first feature of 7.0 :slight_smile:

1 Like

Thanks a lot buddy! I am going to get the shit massaged out of me every day :joy::joy::joy: and finally without the kids and coding…

2 Likes

man! No rush and enjoy your time off!

1 Like

Hi everyone!

@sebavan @Evgeni_Popov @Deltakosh

Which is your preferred way to test framework additions/changes? I tried all the available options and I find the Run and Watch Dev host (ES6-Dev) in VS Code as the best one and write test code in devHost/src/createScene.ts. Any other hints/recommendations for a new contributor? :slight_smile:

Thanks a lot!

I must say I never wrote unit tests, only visualization tests!

Regarding visualization tests, it’s only a matter of creating a PG and adding it to the packages/tools/tests/test/visualization/config.json file.

The reference picture is automatically generated when you first test the PG:

npm run test:visualization -- -i "webgl2" -t "the_name_of_your_visu_test"

Don’t put special characters like “+”, “/”, etc in the name fo your visu test, else the -t syntax won’t work.

2 Likes

Agreed. And while developing I’m using the run PG option as well in vs code

2 Likes

@Evgeni_Popov @Deltakosh

So guys in general I can use the Dev host/createScene.ts to put everything together and if it seems to be working correctly should I write visualization tests so we can test that the functionality is not broken by future changes?

What I’m doing is using “Playground Serve for Core (Dev)”. That way, I can use the Playground locally, make changes in the (Babylon) source code and they will be visible instantly in the local playground. When everything is ok, then I can directly use the playground id in the visualization test config file.

This is what I needed :slight_smile: Thanks a lot!

3 Likes

Hi guys!

@sebavan @Evgeni_Popov @Deltakosh

I have some extra utility/helper functions for GreasedLine. These functions are like circle, bezier, divideLine, smoothLine, segmentizeLine, etc. and are not needed for GreasedLine but are very helpful for preparing the line points. Where should I put this file called GreasedLineTools.ts? Core?

Thanks!

1 Like

I think the best location would be Misc/GreasedLineTools.ts? Let’s wait for @Deltakosh / @sebavan answer.

1 Like

Agreed. We want to have an autonomous feature as much as possible

Hello @Evgeni_Popov!

I am trying to remove some lines in the shader using the material plugin, but this doesn’t work:

'!gl_Position\\=viewProjection\\*worldPos;': '' 

This works:

'!gl_Position\\=viewProjection\\*worldPos;': '//' 

Shouldn’t there be a possibility to replace it with an empty string?

Thanks!

R.

Initially, there was only the injection point “#define XXX” and no regexp. In this case, it was useless to replace the define with an empty string, so it was ignored.

Now, with regexp, this is something we might want to do, but changing the behavior would be a breaking change, so using an empty comment as a replacement string is a good workaround!

1 Like

Another question :slight_smile: @sebavan @Evgeni_Popov @Deltakosh

How to deal with picking? Any examples I can follow?

GreasedLine has a raycast method which returns all intersections of a Ray with GreasedLine.

I think you can take example on what LinesMesh is doing. The easiest way is to look for LinesMesh in the sources (as a whole word + case sensitive).

1 Like