Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000847 [Croquet] Jasmine minor always 01-26-05 01:25 01-26-05 20:33
Reporter elenzil View Status public  
Assigned To
Priority normal Resolution open Platform
Status new   OS
Projection none   OS Version
ETA none Product Build
Summary 0000847: TTorus: alpha < 1 disables rendering
Description I'll look into this.
Spheres and Cubes are fine.

TeaTest new openInWorld.
TParticle allInstances last removeSelf.
space _ TSpace allInstances last.
d _ TTorus new.
d material: TMaterial new.
space addChild: d.
d segments: 30.
d radius: 3.
d innerRadius: 1.
d material diffuseColor: #(1 1 1 0.5) asFloatArray.

s _ TSphere new.
space addChild: s.
s material: d material.

c _ TCube new.
space addChild: c.
c material: d material.
Steps To Reproduce
Additional Information
Attached Files  TPrimitive hasAlpha and renderAlpha.1.cs [^] (1,091 bytes) 01-26-05 20:33

- Relationships

- Notes
(0001103 - 118 - 124 - 124 - 124 - 124 - 124)
elenzil
01-26-05 01:44

.. well i've looked into it and have no clue.
it seems to be getting to the renderPrimitive routine when appropriate.
 
(0001104 - 74 - 74 - 74 - 74 - 74 - 74)
elenzil
01-26-05 01:52

sometimes i see the same thing rather unpredictably with other primitives.
 
(0001105 - 839 - 926 - 926 - 926 - 926 - 926)
Bob Arning
01-26-05 16:11

The reason for this behavior is a difference in the implementations of #hasAlpha and #opaque. An object is rendered in the first render pass if it is #opaque, for which a direct check of its material is made. An object is rendered in the second pass if it responds true to #hasAlpha. This tests not the material directly, but materialAlpha, which is set if the material has an alpha < 1 WHEN IT IS ADDED TO THE FRAME. So, you can see what you expect to see if you rearrange your code as:

TeaTest new openInWorld.
TParticle allInstances last removeSelf.
space _ TSpace allInstances last.
d _ TTorus new.
m _ TMaterial new.
space addChild: d.
d segments: 30.
d radius: 3.
d innerRadius: 1.
m diffuseColor: #(1 1 1 0.5) asFloatArray.
d material: m.

It would also be useful to get #opaque and #hasAlpha into a consistent state.
 
(0001106 - 509 - 545 - 545 - 545 - 545 - 545)
elenzil
01-26-05 20:32

i see..

is it possible that materialAlpha was first introduced with the notion of 'alpha' meaning 'original', and then later misinterpreted as meaning 'transparent' ?

I'm uploading a change set which modifies TPrimitive #hasAlpha and #renderAlpha to use simply material instead of materialAlpha. This change makes my original example code work fine. There are undoubtedly other places such a change should be made. (Possibly materialAlpha should be eliminated entirely ?)

Thanks for clarifying this.
 

- Issue History
Date Modified Username Field Change
01-26-05 01:25 elenzil New Issue
01-26-05 01:44 elenzil Note Added: 0001103
01-26-05 01:52 elenzil Note Added: 0001104
01-26-05 16:11 Bob Arning Note Added: 0001105
01-26-05 20:32 elenzil Note Added: 0001106
01-26-05 20:33 elenzil File Added: TPrimitive hasAlpha and renderAlpha.1.cs


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
46 total queries executed.
33 unique queries executed.
Powered by Mantis Bugtracker