Controlling Wardiso slope through nodes

Hello!
I found out that Wardiso specular highlights are physically most accurate out of all the specular highligh types in BGE.
What I wanna do, though, is controlling Wardiso slope through nodes. Is it somehow possible?

No not possible.

Very sad. If I’d know how to implement this, I would send a patch to Blender as this would come very handy for me. The wardiso matches specular highlights of Unity, it is pretty accurate and has energy conservation. I really wanna see it in nodes!

I am heading on to make my first patch out here, but it will currently modify just hardness of cock-torrance and phong. However, I am not sure if I succeed making it…

I failed a bit and made a huge mess.

http://www.pasteall.org/60952/diff

Maybe someone can help me fixing it?

Do not patch your actual Blender(the one you use for making something) with this, if you are using this patch, create a seperate blender source code build. Otherwise you’ll corrupt your Blender!

Integer seems not to work with nodes. I changed the value to a float.
The new hardness input can be found in the extended material node.
http://www.pasteall.org/60974/diff

Thank you, I’ll test it tomorrow!

OK! Appears to work pretty well. Does it also work with Wardiso specular highlight type? If so than it is just great. Can you commit it?:slight_smile:

Does it also work with Wardiso specular highlight type?

This patch only works for the hardness. The Wardiso slope value has his own variable.

Can you commit it?

Not for the moment. I fixed this patch only for you.

  • I don’t like that it is a float value instead of an integer in the node.
  • I don’t like that the value is not the last one on the node. It should have the same order as in the material.
  • I don’t know if we should add this to the standard material too. This need to discussed with the other developers.
  • I can’t directly add new features to the master without having the OK from two other reveries and in case that this patch is no BGE patch I need a third reviewer, a Blender reviewer (module owner or Campbell).
  • Normally such values are global for the whole material. So I don’t know if this input node is really necessary. Because we have the global value in the material. Except you want to change the value per pixel, e.g. by using a texture or some algorithm.
    [LIST=1]
  • So why it is necessary to change the value in the node?
  • Do you have an example?

[/LIST]

It is needed exactly for my PBR node. So that it can be easily edited in node editor by using texture there. Manually accessing material and having seperate material for each node material would be pain and framerate un-friendly. But I want my node to be user friendly, easy to use and performant, framerate-friendly. I hope you understand what I mean!

I hope you understand what I mean!

I don’t think I got what you mean. Because…

Manually accessing material and having seperate material for each node material would be pain

Changing the value in the material tab or on the node make for me no difference. And you still need the same amount of materials.

and framerate un-friendly

With or without this input, the shader has the same size and so the performance is the same.

It is needed exactly for my PBR node.

I thought you want the slope value and not the hardness?

For now you can make two materials and blend between two materials with the MixRGB node. Then you can get nearly the same effect and can use a texture as input.

OK! 2 materials sounds also hopeful… However, it is less performant than using one material as lighting probe for all the PBR materials(by just having one material in PBR node group).