jPCT - a 3d engine for Java > Projects

Racing Game

(1/3) > >>

Neoteric:
After having done a little research on Java3D I decided there wasn't anything like enough support or examples for it, so I'll be using JPCT.

I will be basing my game on the classic Stunt Car Racer:



I'll update on how it goes and when my site is up. :)

A question though... I would like my landscape to be sun-lit (i.e from a distance and static) what would be the way to do this?

Also how is texture repeating set so it isn't streched over the whole landscape?

EgonOlsen:

--- Quote from: "Neoteric" ---A question though... I would like my landscape to be sun-lit (i.e from a distance and static) what would be the way to do this?

--- End quote ---

I can imagine three different solutions to this problem:
1.) Code the lighting information into the texture. This may produce nice results in some cases, but to be honest i doubt that will in your case.
2.) Use the normal lighting jPCT offers. Place the "sun" in the distance and play with the lightMul, linearDiv and fadeOutLight parameters in Config. Maybe it's possible to produce the desired effect this way.
3.) (and this is NOT possible at the moment but something i'm still thinking about)...use a kind of simple VertexShader-Interface to implement some things on a vertex-level for yourself. Problem with this is, that i have to find a logical, convenient and fast way of doing this and that isn't that easy. Anyway, it won't help you much hear me talking about features that may come in the future...

So i suggest to go with the dynamic lighting jPCT offers. If it really doesn't work, please let me know where the problem is...maybe i can do something about it.



--- Quote from: "Neoteric" ---
Also how is texture repeating set so it isn't streched over the whole landscape?
--- End quote ---

That's not possible, because that would hurt the software-renderers performance too much. If you really need it, do the modulo-calculation by yourself on the texture-coords (before calling addTriangle()). But that will require that you build the object by yourself (i.e. not using one of the loaders in Loader). IF the vertex-shader-stuff mentioned above would be in jPCT, it should be possible to do such things in a more convenient way...IF.... :wink:

BTW: I loved stuntcar racer. It was a great game to be played via a (null-)modem connection.

Neoteric:

--- Quote from: "EgonOlsen" ---
I can imagine three different solutions to this problem:
1.) Code the lighting information into the texture. This may produce nice results in some cases, but to be honest i doubt that will in your case.
2.) Use the normal lighting jPCT offers. Place the "sun" in the distance and play with the lightMul, linearDiv and fadeOutLight parameters in Config. Maybe it's possible to produce the desired effect this way.
3.) (and this is NOT possible at the moment but something i'm still thinking about)...use a kind of simple VertexShader-Interface to implement some things on a vertex-level for yourself. Problem with this is, that i have to find a logical, convenient and fast way of doing this and that isn't that easy. Anyway, it won't help you much hear me talking about features that may come in the future...

So i suggest to go with the dynamic lighting jPCT offers. If it really doesn't work, please let me know where the problem is...maybe i can do something about it.
--- End quote ---


Number two was the one I was heading for, didn't realise there were lightMul, linearDiv and fadeOutLight peramiters, I haven't gone through all the documentation yet. Either that or I can try and calcualte the normals and shading myself, which I don't really have time to do at the moment.


--- Quote from: "EgonOlsen" ---
That's not possible, because that would hurt the software-renderers performance too much. If you really need it, do the modulo-calculation by yourself on the texture-coords (before calling addTriangle()). But that will require that you build the object by yourself (i.e. not using one of the loaders in Loader). IF the vertex-shader-stuff mentioned above would be in jPCT, it should be possible to do such things in a more convenient way...IF.... :wink:

BTW: I loved stuntcar racer. It was a great game to be played via a (null-)modem connection.
--- End quote ---


Yeah, that makes sense. I guess I could piece togeather the landscape into a patch work so the texture is split into smaller areas, shouldn't have too much impact on the over all speed and also very simple.

...that reminds me I have to give the OGL version a go.

I downloaded SCR on an emulator a while ago, can't get enough of it. If I get off the ground with this hopefully my stunt car racer will be upto 6 player over TCP/IP, I won't get around to implementing that until after the physics though (obviously) and that when my universtiy work is out the way.

Thanks for your time. :)

Neoteric:
And another question. I'm fairly new to 3D graphics so how big can I expect to make a level for a first person game? Especially if it was again spread across a large landscape again, including collision detection, interiors and perhaps lights, can the engine cull fast enough with a view frustum etc? or should I opt for a scrolling tile basis?

Something like the Project IGI engine is what I have in mind.

EgonOlsen:
Good question. jPCT's design is targeted to be a game oriented but versatile 3D engine while maintaining a reasonable size (of the jar) and i added some optimizations (i.e. the portal stuff) for indoor rendering. For large outdoor scenes, a quad- or octree would be more usefull (and maybe ROAM...), but even then...it's still Java. As much as i like Java, the fact remains that it isn't the fastest language around. I may add an octree implementation one day (at least it's on my list of "maybe-i-should-do-this" things) but i'm not sure if this would make something like Project IGI  possible. No one ever tried to do something like this in Java so there are no references. I believe that a lot more is possible with jPCT than i can think of at the moment (i'm always wondering what people are doing with the engine...it's everything but usually not what i have in mind when i'm programming... :D ).
About the frustrum culling: jPCT uses frustum culling on a per sector (for portal rendering), per object and finally per polygon base. It may help to split a terrain like in IGI into objects...which is a rather unlogical approach but it *may* work. Just a thought....

BTW: I had a look at your email-address. Are you the guy who wrote this raycasting applet with the slightly wrong rendered floors?

Navigation

[0] Message Index

[#] Next page

Go to full version