Making a object transparent without using transparent textures

Is there a way to simply make a object or a entire node simply get transparent? no matter of it's textures? and also choose how transparent it will be?



(that would solve my damn camera problems)

Have you tried using materials with alpha?

can i? i shall try this now ;D



you meant MaterialStates? i haven't managed, which type of collor should be transparent? Ambient? Specular? then all? i don't really understand how they work :confused:



i haven't manged using MaterialStates, they are set by "setRenderState(ms);" right? then you just "updateRenderState();" or there something more? because i tried to add a "new ColorRGBA(255,255,255,128)" on each of the collors (separatly, now i will try all at once) and it haven't made the node transparent (i've added to the "destructables" node, that have a lot of StaticPhysicsNodes on it, that each have a cube WITH a texture. transparent material state works if the cubes have a Texture?

You can check out TestRenderQueue for an example of using MaterialState to do transparency.

managed to make it transparent! but i got some lot of problems :confused:



what i wanted is that the whole blocks cube behaviored as if it was just one mesh with no internal faces, instead of each becoming transparent. like, only the most extern faces should be rendered as transparent, while all intern faces just won't show, and the inner cubes won't show too, but the last face be rendered as transparent also. there is a way?



all i managed was to cull the inner faces from each block, but not the inner blocks :confused:

also, even setting:

loadedLevel.getDestruc().setRenderQueueMode(Renderer.QUEUE_TRANSPARENT); and

DisplaySystem.getDisplaySystem().getRenderer().getQueue().setTwoPassTransparency(false);

the transparency stills instable, as it changes what is shown or not when i move the camera :confused:



also, if i make then ignore lighting so they won't get darkened by the red light that the fireball emits they stop being transparent :confused:



probably it got confuse :confused:





Edit: i might have came to a solution, but it's quite troublesome to implement…



right now, my Destructible Cubes are made of a class named Cube. it consists of: a Box and a PhysicsBox, it manages the Cube health, texture, and if it dies, it removes the Cube from the play. if i change it to:

6 Planes, one PhysicsBox, 6 Pointers to another Cube. so each face will be directly linked to a Pointer, if there is already a Cube there, don't show the face, if there is not, show it! but it will be REALY troublesome to implement, if no less troublesome solution comes i guess i will have to use this one :confused:

Im kind of confused as to what you are trying to do, but in openGL Materials deals with lighting; vertex coloring deals with no lighting.  So when you turn the lights off it is using the color that is set on the mesh, and hence the alpha value from the color…


TriMesh.setDefaultColor( ColorRGBA color );



Hmm, anyways! managed to get the cubes to get properly transparent, now each cube is made of 6 Quad s, instead of a Box object.



they get transparent as i wanted, if there is a ball 100 units below any level of cubes, only that and above levels will get transparent, but now my ParticleTrail (made by the method in GraphicManager and attached to any every ball) is rendered before the transparent cubes! (they are attached to the rootNode before the ParticleTrail that is attached along with the ball) both the Cubes and the ParticleTrail are in the Renderer.QUEUE_TRANSPARENT, so i tough that it would workout by itself… it's quite hard to understand, so i will link the most updated code on googlecode: "http://3d-pong.googlecode.com/svn/trunk"



so you can check for yourself what's happening, you can move the camera with ASDW at 9 set directions. the trail on the ball will be at first only visible when the ball get to the left wall (if the camera was not moved), then each time it gets to a wall, the lowerest Block level is not breakables, you can change it at line 59 of LevelOne class, the first boolean that is set to "False" determine it as Not Breakables, the trail works as intended below the blocks when they get transparent, so would be not needed to see it below the blocks, the problem is that it disappear if the ball is above any of the transparent(when they are not transparent) blocks.



hope it's not confuse. if it is, a seeing the problem is better than 1000 pictures of it, and those are 1000 times better than words each ;D

If you can just post a single test class (based off of ALL the tests in jME) that someone can just copy and paste (limited to ONLY the problem at hand) that would make helping you much easier…

let me if i can, will take some time, i will edit this reply if i manage



Edit: oh, you meant in one file? no i can't, the the trail need a texture with alpha on it… since the problem is about transparency, making a trail with no transparency (using no texture) will not work, so even if i manage to make a single class that simulates the problem, i still need the texture for the trail, what is not as simple as Copy/Paste

since it needs a specific path to the texture and so so…



just checked it, if you simply download the svn and it will run the project(netbeans project… probably this will make it quite hard for Eclipse users to help me) it will work. quite more complex than Copy/Paste, but works…



unhappily that's the better help i can offer to get help :confused:

Okay, I took a few minutes and ran your project; I STILL don't understand what you are trying to do…



But one thing I notice is that there are pretty much no BoundingBoxes on you stuff…



(FYI you are doing things with your model paths that make it so it will ONLY run on windows…)



This is what your texture paths come out on OSX:

/Volumes/Storage/JavaApplication31/trunk/3D-PongResourcesTexturesTechWall.jpg