Yes. Although everything consists of the car and the track (which isn’t that good)
Yet another question Is it possible to make a material in Java3D look something like the car in this screenshot:
http://www.dennisbijlsma.com/data/ferrari3d/shader.jpg
I’m guessing it uses a custom pixel shader, as the differences in color seem to be caused by the sky texture, so there must be some raytracing involved. This look probably isn’t possible with Java3D’s standard Appearance class, but there seems to be little to no information about how to use GLSL shaders, and I don’t think I’m capable of writing one myself. Is there anyone who can point me to some sort of starting point for this?
Every time I download the file it’s corrupt when I try to open it :-\
[quote]'m guessing it uses a custom pixel shader, as the differences in color seem to be caused by the sky texture, so there must be some raytracing involved. This look probably isn’t possible with Java3D’s standard Appearance class, but there seems to be little to no information about how to use GLSL shaders, and I don’t think I’m capable of writing one myself. Is there anyone who can point me to some sort of starting point for this?
[/quote]
You don’t (necesarily) need pixel shaders to pull that of, let alone raytracing
Look up for the term “environment mapping” on google, it’s a cheap way of achieving that effect.
Thijs
Erm…yes, you are right. I thought it had something to do with pixel shaders because that’s where I first saw it.
However, I couldn’t find any actual example on how to use it in Java3D. I know that I must render an image taken from the car, combine it with the existing texture, and then use the TexCoordGeneration class to make it look spherical. Is there some actual example of this being done on the internet, and if so, where ???
Most games don’t bother having dynamic environment mapping, the cube maps are just calculated ahead of time somehow (either when the level is made or using a generic artist drawn texture).
Edit: Got it working now, the effect isn’t that noticable, but those little graphical touches make a big difference.
I assume you used a TexCoordGeneration object in REFLECTION_MAP mode for the second ‘gloss’ texture?
OK, I’ve finally finished a stable version. You can download it at http://www.freewebtown.com/dennisbijlsma/files/ferrari3d/ferrari3d_150.zip. I also changed the link in the first post. Performance still isn’t too great, but I can’t think of any quick ways to improve it, and it’s not too bad if you have a decent graphics card. Maybe I’ll continue on this in the future, but for now thanks to all who have looked at and answered my questions!
@otelo: Yes
…or you can use the java.awt.Robot class to move the mouse to where you want, press and release a mouse button. (but I think it is a little slower)
good job
I am currently working on mu own racing game and but I am facing some problems with moving my car. I want it to look realistic (including acceleration for example) so decided to go with KeyNavigatorBehavior but still its not really what I want, could you tell me how did you implement the way to control the mobile ?
cheers, Lukasz
Hey man, I really think the HUD is gonna kill your frame rates. I’ve tried painting on the Canvas before in my game and it was killer. Now I’m painting on several small QuadArrarys for each major group in my HUD (this is for a space sim game).
And how do you fill your Quads? I found that painting with Java2D and creating a new texture each frame can be a performance drain as well.
You paint with Java2D in both cases. The difference is you DO NOT have to repaint every frame when using a QuadArray; however, you DO have to repaint every frame when painting on the Canvas. This is where you can save performance. I can’t remember how often I update (every x milliseconds or something - I can check when I go home if you want).
Make sense?
makes sense
OTOH this would not make a smooth HUD (e.g. for a flightsim) possible, which needs to be updated each frame?
Not true. You have to think about the information that is being convaied in the HUD. For instance, console messages do not need to be updated all that often (b/c people aren’t typing and events aren’t happening every frame). Almost every peice of information in the HUD is static from frame to frame. So you take some time slice to determine when the HUD needs to really be updated. This can save you alot especially if you have transparency in your HUD.
BTW, what does OTOH mean?
Is it although?
OTOH == on the other hand
Think of a HUD that you have in jet sims, current horizon, angle-of-attack and so on. These displays have to me smooth.
I’d not call console text to be a HUD, thats just a GUI. HUD is a defined term in avionics.
Well, in video games a HUD is usually defined as the tertiary information that is displayed to the user.
In FPS’s, health, ammo, number of lives, and etc are common elements in the HUD. And yes, text are very much an important function of the HUD.
I agree that HUD components need to be smooth. But smooth != updating every frame. Some HUD components might need to be updated more often then others, but still doesn’t necessitate every frame.

You paint with Java2D in both cases. The difference is you DO NOT have to repaint every frame when using a QuadArray; however, you DO have to repaint every frame when painting on the Canvas. This is where you can save performance. I can’t remember how often I update (every x milliseconds or something - I can check when I go home if you want).
Make sense?
First of all, nice to see my thread bumped after six months. I actually did experiment with using Quads as a HUD, but the graphics looked fuzzt for some reason, and they were stuttering a bit. These problems seem to be standard for Java 3D users, just search on this forum for ´Java3D HUD´ and you´ll find multiple threads on this. I eventually decided that it wasn´t worth the haasle, and did my HUD the J3DGraphics2D way. The performance loss isn´t that bad, I still get a framerate between 25 and 35, which I think isn´t that bad.
yea, but try running the game on an older system. I was shot, fired, and burned at the stake when my buddy couldn’t run an alpha of my game b/c his 5 year old PC couldn’t get more then a few frames a second (I was getting about 25 - 35 FPS on my system w/ a Geforce7800). Once I changed to Quad Arrays, he can now play smoothly (not sure of his FPS but its playable for him).
As for the fuzzy problem, I know in the past I have had issue’s with using Text3D and scaling. You also might run into that using awt on a texture if your image size isn’t a power of two. So you may want to try that.
Hi there Mr. Gol,
I was looking forward to trying out your car game but unfortunately the link seems to be changed to an IP virus checker ???
Is there anywhere else that the download is available from??
Thanks a mill,
Paddy