Hi, English is not my native language, so please understand.
I made some model, animation, and shader(material) in blender. (Version of blender is 2.76)
But, I only succeed to import model , and failed to import animation(but solved) and shader(material).
Change Model to egg was simple because of YABEE,
With animation, I failed to load in panda3d, so I coded everything in script.
And shader(material), I already expected that YABEE can’t change to egg.
So I exported it using gpu.export_shader(scene, material) in blender, and imported in Panda3D,
But I failed…
I want to use blender as WISIWIG(What I See Is What I Get) editor for shader.
What should I do to import this shader in Panda3D?
You probably need to set up the shader inputs for the shader correctly. The easiest way to do this is to rename shader inputs used by the shader to ones that Panda3D will automatically supply. If you post the exported shader, I could help with this.
It uses two textures, bound to shader inputs called samp0 and samp1. You’d have to pass in the textures using setShaderInput(“samp0”, texture0), etc.
The fragment shader also uses a uniform called unfinvviewmat. You can probably replace it with p3d_ViewMatrixInverse, assuming that it is what it says on the tin.
Following the paths where it is used, it seems that the three vertex attributes that are used refer to the following:
att0 = “OrCo”
att1 = “UV”
att2 = “vcol”
OrCo is a concept that’s specific to Blender. You would have to either generate this vertex column in the geometry data. I believe YABEE can automatically export an “ORCO” UV column if the texture uses it, so you might be able to replace “att0” with “texcoord_ORCO”, but I’m not sure whether it will work. It may be easier to change your material so that it does not use “Generated” coordinates, but UV only, and simply ignore this column.
As for att1 and att2, you can replace that with p3d_MultiTexCoord0 and p3d_Color, respectively.