Alpha sorting for coumpound objects

Hello

i got a batiment with a neon text on it (these are two separate geometries)
the batiment is shaded with lighting material, the other one is alpha glow rendered

the issue is that the batiment is always rendered after the neon text
probably becos the actual center of the neon geometry node is inside the batiment AABB
the only trick i found to change this is to have the center position of the neon away from the building AABB (i guess)
but it does not always work

i then detached the neon geometry from teh batiment and atached it directly to the rootNode instead of the the batiment hierarchy
but still got the same problem

is there some way to fix this ?

|____Node [Models/SnackBar.blend] Dynamic
               |____Node [SnackBar] Dynamic
                    |____Geometry [SnackBar1] Dynamic
                         |____Mesh [718]
               |____Node [Neon] Dynamic
                    |____Geometry [Neon1] Dynamic
                         |____Mesh [1112]

[java]
Node node=(Node)main.getAssetManager().loadModel(“Models/SnackBar.j3o”);
neon = node.getChild(“Neon”);
Material mat=main.getMaterialFactory().CreateGlowMaterial(new ColorRGBA(1,1,1,0.1f),“Textures/SnackBar_Diffuse.png”);
mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
mat.getAdditionalRenderState().setDepthWrite(true);
mat.getAdditionalRenderState().setDepthTest(true);
mat.setBoolean(“UseMaterialColors”, true);
neon.setMaterial(mat);
neon.setQueueBucket(RenderQueue.Bucket.Transparent);
[/java]

these alpha sorthing stuffs just drive me crazy

thx

Just for kicks, try putting neon in Translucent bucket and see if it helps?

If your neon is being rendered first then that implies that the snack bar or whatever is also in the transparent bucket. Objects in the opaque bucket are always (always) rendered before objects in the transparent bucket.

As abies suggests, if your snack bar must be in the transparent bucket for some reason then you can move the neon to the translucent bucket… this one is always drawn after the transparent bucket.

Alternately, you can come up with some strategy using a custom GeometryComparator for the transparent bucket that sorts based on a different strategy.

<cite>@abies said:</cite> Just for kicks, try putting neon in Translucent bucket and see if it helps?

thx
but translucent make it draw over everything all the time

<cite>@pspeed said:</cite> If your neon is being rendered first then that implies that the snack bar or whatever is also in the transparent bucket. Objects in the opaque bucket are always (always) rendered before objects in the transparent bucket.

As abies suggests, if your snack bar must be in the transparent bucket for some reason then you can move the neon to the translucent bucket… this one is always drawn after the transparent bucket.

Alternately, you can come up with some strategy using a custom GeometryComparator for the transparent bucket that sorts based on a different strategy.

yes, that’s what i had tried (forcing the snackbar to be in the opaque buffer)

i’ll check thet GeometryComparator thingy

thx mate

<cite>@pspeed said:</cite> If your neon is being rendered first then that implies that the snack bar or whatever is also in the transparent bucket. Objects in the opaque bucket are always (always) rendered before objects in the transparent bucket.

As abies suggests, if your snack bar must be in the transparent bucket for some reason then you can move the neon to the translucent bucket… this one is always drawn after the transparent bucket.

Alternately, you can come up with some strategy using a custom GeometryComparator for the transparent bucket that sorts based on a different strategy.

i can’t find any example
how to i get access to the actual render queue ?

ok i found my mistake
the snackbar was set to transparent somewhere else in the code
my bad
thx for the precious help

golden rule : “If something is being rendered first then that implies that that something is also in the transparent bucket.”

:slight_smile:

The buckets are always rendered in a particular order so if you see something counter to this then it means that your stuff isn’t in the buckets you think. Sort of a more general version of your golden rule.

Within a bucket is when the geometry comparators can help. I have one included in Lemur that allows spatials to be annotated with a layer number to force particular ordering of children.