Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (489)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (555)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Transparency and Lighting  (Read 1188 times)
0 Members and 1 Guest are viewing this topic.
Offline kevglass

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Posted 2003-11-22 07:12:25 »

Do these two things work together currently?

I'm finding if I enabled lighting on a material for an appearance the transparency settings have no effect.

Any help appreciated,

Kev

Offline Preston

Senior Member


Medals: 4



« Reply #1 - Posted 2003-11-22 09:05:21 »

Well, I think I can help with a Xith3d question - for the very first time. :-)
Basically the same question I've asked some days ago, but unfortunately I've hidden it in another poster's thread, so it's hardly noticeable.
Please have a look at here: http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=xith3d;action=display;num=1067981426;start=15

The exact technical details have been revealed by Yuri in the linked thread. However, because the topic really fits better to your new thread here, please let me quote Yuri's two main articles:

Quote
Well, some points on alpha blending.

There is no bug in this functionality, but this is a bit incompatible with Java3D. I just committed new test - Xith3DTransparencyAlphaTestLight.java - to CVS.

You should use setColorTarget(...) on your material to get transparency working in some (most) cases. The reason for this is that Java3D-style material accepts 3-component colors only, so for now material shader sets alpha to opaque. If you specify color target, appropriate material color will be replaced with color from coloring attributes/vertex colors/transparency attributes.

This is still not clear of what to do with this incompatibility, and I personally prefer to go to more advanced Material that will support different front/back materials and 2-sided lighing model, as well as more sophisticated light control.


Quote
From Java3D docs:

In Xith3D, if no vertex colors present, the color combined from ColoringAttributes and TransparencyAttributes used as a vertex color and set to be same for all vertices.

Also note that default color target in Java3D is DIFFUSE and in Xith3D is NONE.

Yuri

P.S. There is also JavaDoc comments for this method/constants in Xith3D Material.java
Offline kevglass

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #2 - Posted 2003-11-22 09:34:11 »

Doh! Thanks alot Preston!

I actually read the post and totally forgot about it. Thanks again thats done the trick..

My lovely teleport effect works again.

Kev

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Preston

Senior Member


Medals: 4



« Reply #3 - Posted 2003-11-25 15:52:18 »

Always light on in the following. :-)
Is it possible to create a per vertex coloured Shape3D without having to use COLOR_4 ?
For example there's a a per vertex coloured Shaped3 of type COLOR_3 and it shall be made transparent with one value (50% for example), like using "tansparency.setTransparency(0.5f)". This just works for Shape3ds without any COLOR_x in the geometry.
                                                   
With COLOR_4 the appeareance.setTransparency(value) is being ignored or rather overwritten by the per vertex colours' alpha value. While this works fine and allows a good fine tuning of the transparency per vertex, like here:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
IndexedTriangleArray geo = new IndexedTriangleArray(vertices.length, GeometryArray.COORDINATES | GeometryArray.COLOR_4 | GeometryArray.NORMALS, polygonindices.length);
geo.set...

Appearance ape = new Appearance();
Material material = new Material();
material.setColorTarget(Material.AMBIENT_AND_DIFFUSE);
ape.setMaterial(material);

TransparencyAttributes transp = new TransparencyAttributes();
transp.setMode(TransparencyAttributes.BLENDED);
transp.setTransparency(0.5f); // is being overwritten by the vertex colours' alpha values
ape.setTransparencyAttributes(transp);

Shape3D korpus = new Shape3D(geo, ape);


I wonder if there's a simpler way to achieve a transparent coloured Shape3d whit one Transparency-value...?
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Nickropheliac (13 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (27 views)
2014-08-22 19:31:30

atombrot (40 views)
2014-08-19 09:29:53

Tekkerue (38 views)
2014-08-16 06:45:27

Tekkerue (34 views)
2014-08-16 06:22:17

Tekkerue (24 views)
2014-08-16 06:20:21

Tekkerue (34 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (47 views)
2014-08-09 21:09:32
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!