ColorMaterial AmbientAndDiffuse

This post has been temporarily removed by myself pending discussion with moderators on the IRC channel

π

Aren’t we all… got a better method?, then share it :sunglasses:

He actually “learned” after I gave him a shader to use that brought his draw calls down to 1. I gave it to him under the condition that he not share it, or talk about how I solved the problems, and yet here he is talking about what I did to fix his problem as if he learned it on his own. People like this, right here, is why as a programmer, you never give anything out for free, and you never help people out of good faith,

lolwut :smile:

I say, secrets are for fools :wink: you need to read this fully:

http://seenonslash.com/node/3302

I have removed my original post until this controversy is resolved.

Sware, that was really good of you to look into the problem I posted on IRC. I’m very grateful for what you did.

But please be accurate, you didn’t give it to me under any condition. It was only after you gave it to me and we had looked over it that you said “Don’t share it, okay?”

If you had said at the beginning “I’m willing to share a technique with you on the condition that you keep it to yourself”, I would have said “Then please let me stumble on, because I discuss and communicate everything I make use of. That’s how I learn! That’s how my understanding grows.”

Now I did experiments comparing your shader with the original unity gem shader with my gem shader. And I realised that “ColorMaterial AmbientAndDiffuse” has the effect of importing vertex colour into the shader at a much lighter cost than BindChannels. Which increases the number of vertices that can be batched, presumably as it decreases the amount of per-vertex data being copied onto the GPU.

Now I am interested why. I’m curious. It is a facet of ShaderLab that is new to me. And so I’ve asked here. Not in order to get any kudos or credit, but because I would like to understand more about how ShaderLab works. I would have been completely happy to credit you with this discovery, you just had to point out that you would like to be credited, and I would have gladly done it!

These discoveries are not to be buried away! Maybe this is why shader learning resources are in the dreadful state they are currently in; shader writers are forced to conduct their own Western scientific method experiments in order to determine behaviours, as Jessy has done on his fantastic videos.

This isn’t where the power of development is: in which secrets various devs have stashed away. It is in understanding how the whole thing fits together. Some of these people keep questioning, keep digging, until they have the whole machine whirring. And they are very sought-after. I try to get there. I’m not sure if I ever will, (and as I have chronic carpal tunnel I wouldn’t be able to do a lot with it), but I certainly won’t if I have to keep secrets.

Surely it wouldn’t be right if I had to hold my tongue about “ColorMaterial AmbientAndDiffuse” until the end of my days because someone on IRC has handed me a shader that contains that line and subsequently said “don’t share my shader”, and as a result I must forever have a hole in my understanding because I’m not allowed to ask about this line, because it would be giving away the technique?

This is a ludicrous scenario, yes?

I notice you say ‘Or talk about how I solved the problems’ ← that was not in our conversation: look at your IRC log. I would never agree to something like that. I would never accept that condition, because that would destroy my whole way of understanding, which is to constantly play with these techniques, asking every possible question, discussing them until I understand them.

As for giving something out for free, this does not feel like something given out for free. It is as if if you give something to someone, and then change your mind and claim it back. Which works for material possessions, but it can’t work for secrets. I can’t un-know a secret.

π

We discussed how I would probably be including it in one of my packages, and I asked you not to pass it around. You even said to me that I should sell it. You were excited that I had fixed your problem and helped you. I figured out how to apply techniques and things I’ve learned in other shaders to your specific instance, to help you. I asked that you not to share it. Do you want me to write a fucking NDA or something just for you to have a little bit of honor? I spent my time helping you for no reason, and you go talking about western scientific methods of how you figured out what was wrong? You could have very well asked me what it did, instead of posting things here as though you were discovering them. Sure, it’s not an advanced shader, but that’s the point. The point is that I had condensed it into 1 pass and bypassed things that broke dynamic batching. ColorMaterial AmbientAndDiffuse obviously isn’t a secret, but you posted my solutions that I gave you in the context of how they’re to be used. It’s not about how advanced it is, it’s about how shitty you are. Low life.

This will be my last reply here. I fully expect the thread to be removed; even if there are a few snippets of useful shader knowledge, they are heavily buried.

And I am grateful for this!

And I have not shared it.

Only this one line, “ColorMaterial AmbientAndDiffuse” did I take from your code, because that is the command that I am curious about. How can you complain about this? It is here: Unity - Manual: ShaderLab: legacy lighting

Must I forfeit the right ask for an understanding of this command because you have introduced it to me? Is it now somehow proprietary to you? Can I not use this on my future work?

The other lines I pasted were a Bind Channels chunk (taken from my own code) and a commented out ‘//Color [_Color]’ to illustrate that it is no longer necessary to set this manually, thanks to ColorMaterial.

Again, 1. I haven’t shared your code and 2. please don’t ever send me code and then say “keep it to yourself!”. If on the other hand you say “I’m willing to share some code with you on the condition that you keep it yourself, do you agree?” then that is fine. Otherwise it puts me in an awkward position!

What I was getting at is that it often takes a Western scientific method approach to figure out how these basic components function. I was griping. I don’t think one should have to do experiments In this way to figure out how to operate the technology. I certainly didn’t intend to make out that I’m some Einstein of the coding world who has uncovered the laws of shader lab.

It was very ingenious of you to come up with a solution that worked.

I did ask you! and you said “I don’t know, I just pulled bits out of three shaders”. Look at your logs! And I would have been completely happy to attribute the finding to you – just ask: Rather than go straight for my throat! However, subsequent to your finding a solution that worked through, as you say, bolting bits of shaders onto each other, the next step would be to whittle it down and figure out exactly what line(s) of code make the difference, and then to understand exactly what that line is doing. I don’t regard code as complete until I understand every last line. I don’t use a single line of code that I don’t understand.

It was a 2-pass shader: the first-pass rendered back faces, the second pass rendered front faces. So taking out the first pass and fiddling the combiners does “condense” it into a 1-pass shader. What was interesting to me was that just eliminating the first pass on its own wouldn’t trigger batching, whereas using ColorMaterial would.

Now you can’t seriously be saying that this was some secret of yours, and insist I keep quiet about it, surely!

Why not join me in trying to figure out what is going on? Clearly you don’t understand the intricacies of this; you have a completely useless material block right in front of your ColorMaterial.

Really, next time before you help someone, please give them some warning of what is to come!