[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Public WebGL] Weird alpha issue.
- To: public webgl <public_webgl@khronos.org>
- Subject: [Public WebGL] Weird alpha issue.
- From: Steve Baker <steve@sjbaker.org>
- Date: Fri, 29 Oct 2010 22:12:19 -0500
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=sjbaker.org; h=message-id :date:from:mime-version:to:subject:content-type: content-transfer-encoding; s=sjbaker.org; bh=5xFxwtqdEQ6iOvkyHYj HCKzu+c0=; b=MHO0i81Hqv7CVs4h2z19blhg9AA+VMeHm7Zi1MU2X47qSP7L9TH 5JPMpVScIaSUvzvmjZZ0ElyWGTNc5bksdPUMMtB71eeClq4+Y9r3cza+2+Tx1KaN +OPisBnazSYEOa8EEdoAiRg/NkoAKWCisYM9w/WsdzAepDrYgwu7WUW4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=sjbaker.org; h=message-id:date :from:mime-version:to:subject:content-type: content-transfer-encoding; q=dns; s=sjbaker.org; b=MWNPndDci+tXy 0sDo7IOjqjvFWrM5oIURs02EN9DjPog5RPOm9vei/hdAq7Qsf+9EKhftkJyq+Rxe K1VU90BA4nmQEF26wxQf50ehWffOM2CtrxHBBrUeAwgMs3mj9Pb/Gj7rd+Zk/hgg 5WsFeLdFWqxEVHvmJiyE+Z7sgpaduk=
- Sender: owner-public_webgl@khronos.org
- User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100520 SUSE/3.0.5 Thunderbird/3.0.5
I'm running some particle system tests - using an RGBA .png image with
fuzzy mid-grey translucent smoke puffs. There are lots of particles
layered on top of each other.
What's odd is that the smoke puff is much lighter in color on Chrome
than it is on Minefield - even with both browsers running side-by-side
on the exact same Win7/32bit/nVidia machine displaying the exact same
scene. Everything else in the scene looks utterly identical in the two
windows.
I'm kinda suspecting some funky thing going on with pre-multiplied
alpha. Is someone messing with my texture?
DETAILS:
The setup for drawing is:
gl.enable ( gl.DEPTH_TEST ) ;
gl.depthMask ( false ) ;
gl.enable ( gl.BLEND ) ;
gl.blendFunc ( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA ) ;
...with everything else left at default values.
The frag shader says:
float4 color = texture2D ( fire, UV ).rgba * (1.0-smokeAmount) +
texture2D ( smoke, UV ).rgba * smokeAmount ;
color.a *= timeVaryingAlpha ;
gl_FragColor = color ;
}
...and in this case, smokeAmount is 1.0 (so we should see only the smoke
map...and that works) and timeVaryingAlpha varies between 0.0 and 1.0 as
you'd expect.
My image 'onload' function says:
gl.bindTexture ( gl.TEXTURE_2D, texture ) ;
gl.pixelStorei ( gl.UNPACK_FLIP_Y_WEBGL, true);
gl.texImage2D ( gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA,
gl.UNSIGNED_BYTE, image ) ;
gl.generateMipmap ( gl.TEXTURE_2D ) ;
gl.bindTexture ( gl.TEXTURE_2D, null ) ;
Help!
-- Steve
-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email: