Jump to content
  • entries
    941
  • comments
    5,894
  • views
    868,129

Double rainbow all the way across the sky


Josh

4,092 views

 Share

Here is the amazing first shot of Leadwerks Engine 3. Behold not one, but TWO triangles! It's a dual display of isosceles inspiration.

 

blogentry-1-065391400 1283667440_thumb.jpg

 

Believe it or not, this screenshot actually demonstrates a feature that's new for LE3...hardware multisampling. Look carefully at the edges of the triangle:

 

blogentry-1-021239500 1283667462_thumb.jpg

 

This isn't the first time I've done multisampling, but until now it hasn't been possible to use with deferred rendering. It's now possible to combine these techniques with OpenGL4. You'll have our awesome lighting combined with high-quality 16x antialiasing for raytracer-like graphics. Oh yeah, multiple layers of transparency, each with proper light and shadows, will also be supported.

 

I ran into problems getting Code::Blocks to import the glew library. Something struck me when I was Googling around for docs. I became aware that most Code::Blocks programmers are probably coding for Linux, and all the examples I read just assumed I was using MS Visual Studio. I didn't give in to the C++ monster just so I could go off on another "non-standard" (if there is such a thing) development route, so I am back on MSVC. I really don't like the poor (or complete lack of) error handling, but I am just going to have to adjust my coding style to this environment. If anyone knows if either the pro version of MSVC or the Intel compiler will stop on the first error and select the line it occurs on, I would gladly pay for that functionality.

 

As annoying as C++ can be, there are some compelling reasons to write the next iteration of our technology in it. First, I need C++ source code to have something I can sell to professional studios. Second, it is extremely difficult to find programmers willing to work in either BlitzMax or C, and dealing with the interface between BlitzMax and C libraries can get ugly. It's not so technically difficult, but you are doing something in the world no one else is, so there's not any support for it. Having Leadwerks Engine 3 written in pure C++ code allows me to work with other programmers who can handle various tasks like networking, some special effects, and ports to other platforms. It also makes it easier to include external libraries for added features. Finally, only C++ can be used for all the platforms I want to support, including Android, iPhone, XBox, PS3, Wii, etc.

 

C++ programmers will like this a lot because the LE3 command set allows them more power than they have had before. It's possible to write your own drivers for physics, graphics, device input, and have it all work with the core engine. You can also extends existing classes. This is particularly useful for entity programming.

 

Should you switch to C++ for LE3? If you've already got another language you're comfortable with, I don't see any reason to. When you are programming a game, flexibility and production efficiency are more important than the raw speed of the final program. Let's say that C++ gave a 25% speed increase over another language. This is probably not realistic, but for the sake of argument let's use that number. That still doesn't mean much, if the user can get a 300% speed increase by switching the GPU or changing some quality settings. So unless you want to support a lot of extra platforms or you just like C++, I don't see any big advantage when it comes to actual game authoring. I need a C interface for use with BlitzMax, because I intend to continue making the editor with that language. Therefore, our policy of allowing you to "code the way you want", with any language you want, will continue.

 

By the way, Khronos has done a really great job with the design of OpenGL 3.1 and onwards. A few points of interest are that immediate mode rendering is finally done away with:

glBegin(GL_TRIANGLES);
glVertex3f(1,2,3);
glVertex3f(1,4,3);
glVertex3f(1,2,4);
glEnd();

No more! It doesn't make sense to have three different ways of drawing primitives, and it just makes the drivers overly complicated. You should learn the one right way of doing things, from the start.

 

Also, the shaders have all the remnants of the old fixed function pipeline cleaned out. The GPU doesn't have a "color array" or a "texcoord array". It just has vertex arrays and you decide what they are, and what format they should be in. So I can do things like compress surface normals into four bytes and not worry about needing the color array for something else.

 

I didn't get much into it, but it looks like shaders have a nicer implementation of what used to be called "varyings". Variables are just "in" or "out" in the vertex and fragment shaders. Uniforms remain unchanged. I might have a play at geometry shaders, but two years later I am still not sure what they are for, other than something that would have been nice when stencil shadows were popular. Of course, what I am really looking forward to is the OpenGL4 hardware tessellation. :blink:

 

Anyways, I am pretty comfortable with C++, and am happy to be back into graphics, my favorite area of technology. Thanks again to Roland Strålberg for his advice with some C++ details. Have a good week!

 Share

18 Comments


Recommended Comments

Very nice article :)

 

I need a C interface for use with BlitzMax

 

Are you going to release some C headers for LE3 ? Im using only C leadwerks fonctions in my game code, and i want to swith my game on LE3 technology when it will be released and i hope that you are not going to change everything in a radical way :)

Link to comment

The engine will be compiled as a DLL or static lib, and C command will be included. You don't need a separate header file.

 

The commands will just be the class name followed by the method name. For anything that returns a value, the first part of the method name will be "get". For anything that sets a value, "set" will be used. For anything that queries a state, "is" will be used:

 

entity->SetPosition(x,y,z)

EntitySetPosition(entity,x,y,z)

entity->IsHidden()

EntityIsHidden(entity)

Link to comment

It's less natural than "PositionEntity" but with 300 commands, a naming scheme will save people the trouble of looking up the exact terminology. I have to look it up myself sometimes.

Link to comment

In my game project i am doing this kind of thing with all commands:

 

void BaseSoundEngine::PlaySoundSource (TSource Source)
{
PlaySource(Source); // LW command
}

 

So when the command name or arguments are changed i just have to change this function :)

Link to comment

This is not according to global standard:

entity->SetPosition(x,y,z)
EntitySetPosition(entity,x,y,z)	// error: standard violation!

The standard says when using methods, the object comes first (since it's OOP), followed by the OOP seperator and then verb and subject.

In procedural form verb comes first, then object and then subject (and of course the instance of object as first parameter):

entity->SetPosition(x,y,z)
SetEntityPosition(entity,x,y,z)

This is easy to remember, since the procedural form is how you speak in real life too, and the OOP form only puts the object instance in front (so the object instance is not even part of the command, it's just the thing on what you operate).

Link to comment

I don't care about any imaginary standard, but I do agree that SetEntityPosition(), SetBallJointLimits(), GetMaterialTexture(), etc. do roll off the tongue better.

Link to comment

A geometry shader could be used for wires, overhead cables that need to sag and have some form of elasticity. I think the 5th edition superbible had a rubber mattress example that looked neat.

Link to comment
This isn't the first time I've done multisampling, but until now it hasn't been possible to use with deferred rendering. It's now possible to combine these techniques with OpenGL4. You'll have our awesome lighting combined with high-quality 16x antialiasing for raytracer-like graphics. Oh yeah, multiple layers of transparency, each with proper light and shadows, will also be supported.

 

Great! I've been dying for that for so long!

Great post, great mentality, I just can't wait for LE3. L3? IDK. The shortening is cool.

Link to comment

The engine will be compiled as a DLL or static lib, and C command will be included. You don't need a separate header file.

 

The commands will just be the class name followed by the method name. For anything that returns a value, the first part of the method name will be "get". For anything that sets a value, "set" will be used. For anything that queries a state, "is" will be used:

 

entity->SetPosition(x,y,z)

EntitySetPosition(entity,x,y,z)

entity->IsHidden()

EntityIsHidden(entity)

 

??So you are actually going to change the command syntax after all this time? Literally invalidating every existing line of code that has been currently written with the current command syntax? So where is the new command syntax going to be kept at? The wiki? So that means every command will have a listing for LE3.0 syntax and LE2.XX syntax?

Link to comment

??So you are actually going to change the command syntax after all this time? Literally invalidating every existing line of code that has been currently written with the current command syntax? So where is the new command syntax going to be kept at? The wiki? So that means every command will have a listing for LE3.0 syntax and LE2.XX syntax?

Ctrl+H

Find: "EntityPosition"

Replace By: "EntitySetPosition"

Link to comment
??So you are actually going to change the command syntax after all this time? Literally invalidating every existing line of code that has been currently written with the current command syntax? So where is the new command syntax going to be kept at? The wiki? So that means every command will have a listing for LE3.0 syntax and LE2.XX syntax?

I would not count on any of your existing programs to compile verbatim in Leadwerks 3. It's a new engine with some differences in the commands and design.

 

LE2 will continue to be supported, and any bugs will continue to be fixed. It's not in danger of becoming obsolete. If you have existing projects being written in LE2, I recommend you continue using LE2 and maybe use LE3 when you start a new one.

 

The documentation for LE3 will not be in the wiki. It will be an entirely new docs system written provided by Leadwerks.

Link to comment

Ctrl+H

Find: "EntityPosition"

Replace By: "EntitySetPosition"

 

oh really? wow thanks :D ... if it was just one command I wouldn't have said anything... but he is talking about changing the syntax for almost every LE command, meaning that if you want to use any previously working code you would have to do this for every single command... which would mean troubleshooting the same code all over again.

 

I would not count on any of your existing programs to compile verbatim in Leadwerks 3. It's a new engine with some differences in the commands and design.

 

LE2 will continue to be supported, and any bugs will continue to be fixed. It's not in danger of becoming obsolete. If you have existing projects being written in LE2, I recommend you continue using LE2 and maybe use LE3 when you start a new one.

 

The documentation for LE3 will not be in the wiki. It will be an entirely new docs system written provided by Leadwerks.

No, I didn't expect it to compile verbatim since official bmax modules were being dropped, but the change of the standard syntax that we are all used to is kind of a shocker.

 

And I am going to have to agree with lumooja, but not based on the "global standard". SetEntityPosition() has a lot more of a natural feeling than EntitySetPosition().

Link to comment

Yeah, I agree. As far as I can tell, that will work:

SetEntityPosition()

GetMaterialTexture()

SetJointStiffness()

EntityHidden()

 

So yeah, I think that is better.

 

There will be a BlitzMax module because I need one to write the editor. I have a BMX module for Newton that loads the DLL. You can even compile a C++ static lib into a BMX module, and build your program with no external DLLs.

 

Unless something changes in the development plan of BlitzMax 2, there will not be a BMX2 module because AFAIK the language does not support use of external libraries.

Link to comment

There will be a BlitzMax module because I need one to write the editor. I have a BMX module for Newton that loads the DLL.

 

but will all the modules be available to us? All of them like what we currently have now?

Link to comment

thats fantastic news... i guess i misunderstood something at one point and thought that the modules were being taken away... great news!

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...