Hello, I am having a hard time trying to create a material in Blender and map a text book Blinn material.
The way I understand, a Blinn material at a minimum have these kind of parameters give or take few others.
now what I find in blender is something like this.
# Adjust Principled BSDF parameters to simulate Blinn-like properties
# Blinn often has a more pronounced specular highlight and less roughness
principled_bsdf.inputs['Base Color'].default_value = (0.8, 0.2, 0.2, 1) # Red color
principled_bsdf.inputs['Metallic'].default_value = 0.0
principled_bsdf.inputs['Specular'].default_value = 0.5 # Higher specular
principled_bsdf.inputs['Roughness'].default_value = 0.2 # Lower roughness for sharper highlight
principled_bsdf.inputs['Clearcoat'].default_value = 0.0
principled_bsdf.inputs['Clearcoat Roughness'].default_value = 0.03
principled_bsdf.inputs['IOR'].default_value = 1.45
The question is, how to map a the parameters of a standard Blinn Material to blender system, so that the model look at least similar to how it would look on other packages?
I tried few things, but I can’t get to look even close.
can any one post a code snipe that does that?
BTW: her eis my python script:
def ParseMaterials(meshObj, xmlMaterials, layers, faces):
for xmlMaterial in xmlMaterials.findall('material'):
materialName = xmlMaterial.find('name').get('string')
material = bpy.data.materials.new(name=materialName)
material.use_nodes = True
nodes = material.node_tree.nodes
# I do not really understand how to map the Blinn Paremater to a blende material
principled_bsdf = nodes.get("Principled BSDF")
principled_bsdf.inputs["Base Color"].default_value = (0.0, 0.8, 0.2, 1.0)
principled_bsdf.inputs["Metallic"].default_value = 0.1
principled_bsdf.inputs["Roughness"].default_value = 0.7
meshObj.materials.append(material)
#textureName = xmlMaterial.find('texture').get('string')
#print(materialName, textureName)
I guess that I will have to make one myself using shading nodes.
that was not the question I asked.
The question was if this was a functionality that already existed.
This would be such a common problem for anyone coming from a different environment that I though there will be a kind of compound shader solution similar to the “principled_bsdf” that implements the legacy shading modes that are still used today.
I do not want to mention names, but all of the Major commercial graphics packages, still support Lambert, Blinn, Phong shading functionality.
In my opinion moving to a “physcally shader model” is a great feature,
but doing it while abandoning the legacy shaders, seems like a big nearside move for the Blender design team.
people has made movies using Blinn shader, and if you ask me, the physical shader are overrated.
if I am correct, those topics are my point.
there is a difference, between an approximation and the actually thing.
before I came he to ask, I did search for a solution, and I found that all solutions are just approximations that lose some information.
It really baffled that there was no something link a node:
Blinn_brdf, Phon_brdf or something like like that, given that this is so common. and the idea that you have to make the shader with nodes, is just error prompt and time consuming
All you have to do to test this is import an fbx file that was exported form some commercial app. It the large majority of the looks just terrible in blender.
anyway, I got the answer.
Thanks for the answers.
I am closing this
I just want to correct this in case anyone had a similar problem.
It turns out blender do have a set of BSDR shader node, that can implement a reasonable lamber with a least phong or blinn reflection.
The one “specular BSDF” seems to have the inputs to store all of the parameters of a standard Blinn model.
The reason I mention, is because there seem to be a great deal of misleading information by people emulating a Blinn shader using the default “principled_bsdf”. Sadly that might work when working inside blender,
but it doesn’t when you export your mesh to a non .blend format.