@Evgeni_Popov LinesMesh didn’t directly help (anyways thank you! ), but I believe, the intersects method of the mesh must be overriden. I’ll give it a try.
Guys, I’m so excited! It is getting to look really good But I still have to comment the code, write the docs, solve the picking stuff, revise the code (I always find something to improve or to add - for example I forgot dispose in the first round ). Contributing is like 5x times more work than just coding on private projects
Unfortunatelly I was forced to have a break from GreasedLine again. This time that sucker COVID infected me. I didn’t even think that it’s still a threat. This is the 4th time since the outbreak. Now it seriously tries to kill me I was spitting out blood and I’m on oxygen nearly the whole day and I feel I could sleep all day long. Since I am coughing like crazy, I can’t even sleep. More time to code
As a general rule I d suggest to keep it the simplest as possible and grow the options based on user feedback. Back compat being a central point of focus, I agree the API shape is a strong concern.
About your question, in PBR, we basically solved this one with an unlit parameter disabling the multiplication so it is similar to your mode.
Adding this color mode parameter does sound nice to me, as it’s a small thing and it could be useful.
It is, more or less, with the disableLighting property of the standard material (but it does not behave exactly like the unlit parameter, you have to set an emissive color/texture).
I’ve read about this, but it should be casted to float I believe and it’s performance penalty, as I read, but perftest will show the results! Many thanks for both suggestions!
EDIT: Did you notice we are talking about shader code?
Bad luck - switch and the second solution runs at the same speed (approx.) as the if’s.
EDIT: I think, we could see some different result using different approaches on mobile GPUs, what I’ve learned from reading articles about GPU optimizations.
The easiest (and fastest) way would be to have a single colorMode property in the material plugin and use a define to set the value in the shader, something like:
I didn’t use it because I could imagine a situation where the user wants to implement mouse over highlighting of the line just by changing the colorMode to SET from other modes and as you said previously recompilation of the shader is a heavy task. What’s your opinion?
Indeed, in this case, passing the colorMode as a uniform variable and testing all 3 values is the best solution. Branching when the condition involves only uniform variables is normally not very expensive.
Thanks man! I am already past the worst part, still coughing though but I couldn’t resist to smoke and I am just having one I am convincing myself that the 70% oxygen I receive will balance it out