Per pixel lighting

I got bored with the limitations of the Wurm client engine, and started from scratch.

http://www.mojang.com/~markus/shadows.jpg

(Stark2.0 is what I call my jogl testbed app, I’m basing the new client on that framework instead of the old broken code)

Projected textures, dot3 bumpmapping, shadow volumes. Fun stuff.

JOGL kicks ass. =D

So how about opening up the code on the now obviously obsolete old wurmonline render engine? ;D

[quote]JOGL kicks ass. =D
[/quote]
Indeed, it does :stuck_out_tongue:

[quote]So how about opening up the code on the now obviously obsolete old wurmonline render engine? ;D
[/quote]
Hah, right. Rolf (the other programmer on the team) would kill me. =D

But if you’ve got any specific questions on how I implemented something, I’d be more than happy to answer them.

(oh, and I meant “projected lights”, not “projected textures”, although the difference is semantic at best)

Java Cool Dude: yeah, ported stock demos are cool as well. :wink:

Cool. If you look at this thread: http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jogl;action=display;num=1077996204

You can see that I asked something about tile-based terrains. I’m working on something like that on and off for some time now but the going is slow because my 3D knowledge is still very basic.

Some time ago I encountered wurmonline and read the thread where multi-texturing was being explained for blending terrain changes. Very nice but I’m still stuck at simpler problems :slight_smile:

So some questions I could ask are:

  • what kind of rendering do you do for the terrain? Do you use Vertex Objects? Vertex arrays? Something else?
  • do you use any strips or fans in the terrain or is that just not doable if you need complete freedom to change the texture for each tile?
  • do you do any sorting of terrain tiles by the texture they use?

The answers to these would already help me a lot :slight_smile:

Some questions out of pure curiosity:

  • what kind of culling do you use? Quad trees?
  • do you do any occlusion on the terrain? (“No need to draw anything behind the large mountain”-stuff)

I hope you don’t mind answering all this, especially because good answers will only beget more stupid questions :slight_smile:

But maybe others will learn from this as well. Because I know there’s a lot of information out there about all kinds of things having to do with terrain rendering, but it would be nice to have someone with experience to tell what worked and did not work (for him).

  • what kind of rendering do you do for the terrain? Do you use Vertex Objects? Vertex arrays? Something else?

In the current wurm online I just send each vertex manually. It’s slow. :wink:
I used to use one vertex array per “chunk” to speed it up, but I got a massive slowdown when starting wurm to allocate all of those native buffers (several thousand), so I had to take it out. (got about 5% more fps with that in)
The new engine will use a single large vertex cache thing for all height samples, and the texture coordinates will probably be generated by a vertex program.

  • do you use any strips or fans in the terrain or is that just not doable if you need complete freedom to change the texture for each tile?

Strips would be possible in the current wurm engine since it’s just a brute force lod on the terrain, but I send each triangle individually. It’s slow. :wink:

  • do you do any sorting of terrain tiles by the texture they use?

No. Good idea.

  • what kind of culling do you use? Quad trees?

I use quad trees for all data like trees and models, but for the terrain I just cull each “chunk” manually. That’s far from optimal.

  • do you do any occlusion on the terrain? (“No need to draw anything behind the large mountain”-stuff)

Nope, I’d need to implement quadtrees for the terrain mesh first.
(coming in the new client)

Lessie what ports have I really done;
Regular celshading (I came up with the vertex shaders version on my own ;))
MD3 Loader
Cloth simulation

The rest is mine :wink:

[quote]The rest is mine :wink:
[/quote]
Yeah, I was just teasing jokingly. :wink:

I know you’ve got m4d sk1llz, and I’m very impressed by a lot of the things you’ve made.

[offtopic]
In wurm online (love how missing textures get the big red X ;D), at the starting what’s an enumeration error due to ?
I mean the world load just fine but I’m affraid I’m missing somthing out there ???

Would you mind emailing me a more detailed description of that problem? (stacktrace, exact error and so) :-/

GLERROR: Invalid enumerant (1280)
That’s about it

Oh, THAT one.

Yeah, that’s GL_NV_fog_distance. I really should check if the extension is available, but it’s so minor I never get around to doing it.