Shader Emmisivity Issue

When testing Cube Map Reflections on a car, i have encountered an error.
I have applied the Per-Pixel shader on the map, but, (since Cube Maps dont support Pixel Shading,) i applied the per-vertex shader on the car. It seemed to work fine at first, but when i applied the texture sheet on the car so that i would look more realistic, an error has occured; the reflections were sahded nicely, but the transparent Texture Sheet appeared Emmisive! I don’t know why, but the two textures applied on the car appeared to be affected by different shading. Help?
The attached screenshot shows what its like, and yes, i used the environment test file to test the reflections, since i’m too lazy to make my own. :3


I’m trying to understand what your textures are like and how you’re trying to combine them; from what I understand, your second texture has transparency and should only be applied where it’s non-transparent? If that’s the case, the default combine mode is MModulate (which multiplies the texture colours together), whereas you would want something more like MDecal.

I use a transparent Texture Sheet on the car which has modified texture coordinates so that it can apply these textures easily. Here is what it looks like. Its transparent so that the reflections would also be visible through the layer.


Textures don’t really work like that by default; they are multiplied on top of each other and the transparency information is not used to modulate the colour information. If you want this behaviour, you should choose a different mode such as MDecal.

Also see:
panda3d.org/manual/index.php/Texture_Modes

I am using MDecal, in fact.
Here’s the source code, i couldn’t attach a file with all the models since its too big.

import direct.directbase.DirectStart
from panda3d.core import *
from panda3d.ode import *

loadPrcFileData('','background-color 0 0 0')
loadPrcFileData('','win-size 640 480')
loadPrcFileData('','framebuffer-multisample 2')
loadPrcFileData('','multisamples 2')


base.car = loader.loadModel("car.obj")
base.car.reparentTo(render)
base.car.setPos(0,0,10)

hood = loader.loadModel("hood.obj")
spoiler = loader.loadModel("spoiler.obj")

hood.reparentTo(base.car)
spoiler.reparentTo(base.car)

windows = loader.loadModel("carg.obj")
windows.reparentTo(base.car)

floor = loader.loadModel("models/environment")
floor.reparentTo(render)
floor.setScale(8,8,8)
floor.setPos(0,-250,0)

light = PointLight('plight')
ln = render.attachNewNode(light)
ln.setPos(100,30,50)
ln.setHpr(0,320,0)

amb = AmbientLight('amb')
namb = render.attachNewNode(amb)
amb.setColor(VBase4(0.2,0.2,0.4,1))

ts = TextureStage('ts')
ts.setMode(TextureStage.MDecal)
ts.setSort(1)

rig = NodePath('rig')
buffer = base.win.makeCubeMap('env',64,rig,BitMask32.bit(0))
rig.reparentTo(base.car)
base.car.setTexGen(TextureStage.getDefault(),TexGenAttrib.MWorldCubeMap)
base.car.setTexture(buffer.getTexture())
base.car.setTexture(ts,loader.loadTexture('Paint.png'))
#base.car.setColor(0,0,1)
        
windows.setTexGen(TextureStage.getDefault(),TexGenAttrib.MWorldCubeMap)
#windows.setTexture(buffer.getTexture())
windows.setTexture(ts, loader.loadTexture('window.png'))
windows.setAlphaScale(0.5)
windows.setTransparency(TransparencyAttrib.MAlpha)
        
base.car.hide(BitMask32.bit(0))
        


#render.setLight(namb)
render.setLight(ln)
floor.setShaderAuto()

render.setAntialias(AntialiasAttrib.MAuto)
        





run()