Panda 1.8: incorrectly generated shaders by shader generator
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Panda3D |
Fix Released
|
Medium
|
rdb |
Bug Description
Operating system : debian squeeze 64 bit
Version of panda3d : Panda 1.8 official and latest builds
By running this code "panda" model is incorrectly textured
from direct.actor.Actor import Actor
from direct.
from panda3d.core import loadPrcFileData
loadPrcFileData('', 'dump-generated
app = ShowBase()
pandaActor = Actor("
pandaActor.
#model = app.loader.
#model.
app.render.
app.cam.setPos(0.0, -40.0, 5.0)
app.run()
and in fact it generates fragment shaders that don't use the sampled texture:
...
void fshader(
uniform sampler2D tex_0,
in float4 l_texcoord0 : TEXCOORD0,
out float4 o_color : COLOR0,
uniform float4 attr_color,
uniform float4 attr_colorscale
) {
float4 result;
// Fetch all textures.
float4 tex0 = tex2D(tex_0, l_texcoord0.xy); <------- not used
result = float4(1,1,1,1);
result *= attr_colorscale;
o_color = result * 1.000001;
}
but for "smiley" model the generated shader seems to be correct:
void fshader(
uniform sampler2D tex_0,
in float4 l_texcoord0 : TEXCOORD0,
out float4 o_color : COLOR0,
uniform float4 attr_color,
uniform float4 attr_colorscale
) {
float4 result;
// Fetch all textures.
float4 tex0 = tex2D(tex_0, l_texcoord0.xy);
result = float4(1,1,1,1);
result.rgb *= tex0;
result *= attr_colorscale;
o_color = result * 1.000001;
}
On panda3d 1.7 all shaders are correctly generated.
Bye
Changed in panda3d: | |
status: | Fix Committed → Fix Released |
Thanks for reporting. I've been able to reproduce the issue and I've checked in a fix. It'll be available in 1.8.1.
A workaround is to ensure that textures are of format F_rgba, F_rgb or F_alpha.