Panda 1.8: incorrectly generated shaders by shader generator

Bug #952093 reported by consultit
6
This bug affects 1 person
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.showbase.ShowBase import ShowBase
from panda3d.core import loadPrcFileData
loadPrcFileData('', 'dump-generated-shaders 1')
app = ShowBase()
pandaActor = Actor("models/panda")
pandaActor.reparentTo(app.render)
#model = app.loader.loadModel("smiley")
#model.reparentTo(app.render)
app.render.setShaderAuto()
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

Revision history for this message
rdb (rdb) wrote :

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.

Changed in panda3d:
assignee: nobody → rdb (rdb)
importance: Undecided → Medium
milestone: none → 1.8.1
status: New → Fix Committed
rdb (rdb)
Changed in panda3d:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.