Parallax offset mapping with WebGL

webgl-logo

Years ago I wrote a demo showcasing different normal mapping techniques with Delphi, but never got around cleaning up the source and releasing it. While working on my WebGL dungeon crawler prototype I dug out the old code, cleaned it up and ported it over to WebGL, so you don’t need a compiler to see it in action and play around with it.

Parallax mapping uses an additional heightmap (together with a normal map) to add more depth to flat surfaces depending on the current camera angle. It’s currently lacking shadowing, but that’s something I might add in the future.

01 03

(Left : Normal mapping , right : Parallax offset mapping)

You can get the sources from my GitHub repository : https://github.com/SaschaWillems/webgl/tree/master/parallaxmapping

(more…)

Read More

Geometry instancing with WebGL 2

webgl-logoWebGL, based on OpenGL ES, brings hardware accelerated OpenGL to your browser, and version 2.0 is around the corner (specs). I’ve been playing around with WebGL (via JavaScript) for some time now (see my GitHub WebGL repo) and recently Google’s chrome (canary) got WebGL 2 support.

WebGL 2.0 adds some interesting new features, with geometry instancing being one of them, so I sat down and wrote a small demo that shows how to render the same instance of a single mesh with differing shader attributes using instancing and only one drawcall :

gl.bindBuffer(gl.ARRAY_BUFFER, buffer with offsets);
gl.vertexAttribPointer(offset attrib location in shader, 3, gl.FLOAT, false, 12, 0);
gl.vertexAttribDivisor(offset attrib location in shader, 1);
...
gl.drawArraysInstanced(gl.TRIANGLE_STRIP, 0, number of vertices to render, number of instances to render);

(more…)

Read More

glCapsViewer 1.0 beta release

I just released version 1.0 (beta) of the OpenGL hardware capability viewer (C++ port using Qt). Note that it’s a beta release and my first C++ (and Qt) application released to the public.

Release on gitHub: https://github.com/SaschaWillems/glCapsViewer/releases/tag/v1.0-beta

Binary downloads (win32) :

https://github.com/SaschaWillems/glCapsViewer/releases/download/v1.0-beta/glcapsviewer_v1_0-beta_win32.7z

or

http://opengl.delphigl.de/releases/glcapsviewer_v1_0-beta_win32.7z

If you find any bugs, please post them in the comment section or (better) open an issue at the github repository.

Right now windows only, other platforms (linux first) will follow as soon as I’ve moved the project to CMake.

Read More

New features and url for the OpenGL hardware database

opengl-logoIn preparation for the release of the next glCapsViewer version (C++), the OpenGL hardware database has been completely overhauled and also got a new url for easier access.

After releasing the sources to the php front end of the database, I decided to clean up the sources for all pages, throw out old (bad) code and add in new features using external libraries like DataTables.

The OpenGL hardware database was my first php based web project, so much of the code wasn’t very pretty, and almost all search and filter functions were hard coded and not available everywhere and for all table columns. Not only did that make it hard to add new stuff, but it also gave a very inconsistent end-user experience.

The new version of the database now uses DataTables on all pages, including a live search, so that you can now easily search for data on every page among every column. Same goes for sorting, as all columns are now sortable, instead of just a few that were hard coded in the old version.

In addition to the new search functionality, the visuals are now based on jQueryUI and BootStrap, giving an easier look on the eye and also adding some convenient features, like having report information in separate tabs for easier navigation. Combined with live search, this should make the database a lot more fun to use.

The database now also has a real url (http://opengl.delphigl.de), instead of the old redirection, making up for much shorter urls than before, e.g. : http://opengl.delphigl.de/gl_generatereport.php?reportID=679

Feedback so far has been positive, and I also received some feature requests that I’ll ad in the future. So if you want to see a new feature, or see something that could be improved, just drop me a line or message me on twitter.

 

 

Read More

Going GitHub with gl(ES)CapsViewer

In my last posting for 2014, I wgithub-logorote a little bit about going open source with my projects. So I took the C++ rewrite of the OpenGL hardware capability viewer as a first step in releaasing more of my sources to the public.

And while I found bitbucket to be fine, I decided to move over to GitHub. Most of the developers I use to interact with are there (and not on bitbucket), and I prefer their UI and functionality over bitbucket (plus they seem to be super active with adding new stuff).

My GitHub repositories are located here.

It currently hosts the C++ port of the OpenGL hardware capability viewer, as well as it’s OpenGL ES counterpart (written in Java), the web front end of the OpenGL hardware database (PHP) and the pascal OpenGL header translation (Pascal).

So if you want to check out progress on these projects or like to fork them, just head to the repository. I’ll add other projects over time, and plan on releasing sources for some of my old (inactive) delphi projects too.

Read More

2014 – Final posting

9903c7c14add3fd0758b7b5b80c24d48101f296f13ce34736799a82c71f61bc2As another year ends, it’s time for a small retrospect. Next year marks the 10th anniversary of my personal blog, so I’ve been posting about my programming adventures for over a decade now (the first version of www.delphigl.de went online 2003 afair) and I’m still having lots of fun hacking code into different IDEs with different languages, though focus is shifting from time to time. And that’s actually what makes coding so much fun, it’s a constant learning progress that forces you to constantly sharpen your coding skills, learn new languages, adopt to new technologies etc.

So yes, it’s very time consuming, but it’s also very rewarding and surely has positive effects on your brain and all other mind-related skills. And I don’t think that I’ll ever stop coding, ’cause that would surely leave a whole in my life that would be hard to fill, especially since it’s so creative.

So here we are at the end of 2014, and lot’s of things happened during that year, so I’ll post a quick summary of the programming related things that moved me during 2014.

Twitter

I’m on twitter now (like anybody else on this tiny planet I guess). The main reason I’m not posting as much on my personal blog as I used to to is twitter. I initially decided to use it because people were talking about my OpenGL and OpenGL ES hardware databases and tools, and wanted to reply to them.

But in the end it turned out to be much more and I’m using twitter now  on a daily basis now. It’s the perfect way of finding like-minded programmers, and you often get instant feedback and end up with interesting discussions. And you also realize that all those coders at google, nvidia, amd, valve, etc. are just regular people like yourself 😉

JavaScript and WebGL

2014-11-16 19_35_20-Unscheinbar (WIP) - Copyright © 2014 by Sascha Willems (www.saschawillems.de)I also did lots of experimenting with JavaScript and WebGL. Though I must admit that it’s a complete different world compared to the strongly typed languages I normally use. I kinda like JavaScript (although it seems most “real programmers” wouldn’t agree with me on that), and compared with WebGL it’s great to see how easy it is to use OpenGL on almost every device out there by simply opening up a browser.

Though WebGL is still in it’s early stages, it’s already shaping up very well, and khronos is putting in a lot of effort to make WebGL the open 3D standard for the web. And I wish them the best luck.

And if you followed my tweets, you may have seen that I’m developing a new game with JavaScript and WebGL. It’s called “unscheinbar” and will be using the random dungeon generator I posted to JS some time ago. It’ll be more of an experiment than a game, with visuals and elements found on trugbild. There’s not much to see yet, as it’s still in it’s very early stages, but I hope to have it up and running some time within the first half of 2015.

And since JS and WebGL are so great for rapid prototyping, I also have a few more game ideas written down somewhere for which I’d like to create some prototypes in 2015.

C++ rocks (again)

A few weeks ago Microsoft dropped the bomb that made m2014-12-21 13_07_00-glcapsviewer 1.0 - © 2011-2015 by Sascha Willems (www.saschawillems.de)e completely move away from Delphi/Free Pascal for my private programming stuff : They released the Visual Studio 2013 community edition.

So with a full (free) Visual Studio available to everyone, I completely stopped using and Pascal related languages for my private coding (Delphi and Free Pascal with Lazarus). The IDE is just awesome, and if you compare it to the fat, slow and buggy Delphi-IDE it just shows that MS is driving circles around Embarcadero.

So for my first (real) C++ projects in over a decade I decided to port the OpenGL hardware capability viewer (glCapsViewer) over to C++, using Qt for the Gui. And it’s awesome. I’m having so much fun writing C++ code in Visual Studio that I can hardly stop (screw the dishes 😉 ).

It’s coming along very nice, and won’t become a simple but port. It’ll be getting some new features and I also plan on releasing the sources to it, so other people can contribute to it.

 

Going open source

For a long time, I had severe reservations on releasing my sources to the public, and with the exception of a few simple projects and headers, most of my source was closed and not available to the public. But with the switch over to new programming languages and platforms, I decided it would be a great way to put my new sources into the public, and that’s why I decided to open up a repository over at bitbucket.

And that’s what I’ll pursue even more for 2015 : Making more of my sources available to the public. Sure, there may be drawbacks like people “stealing” your code and not giving a single f**k on your license, but the advantages easily outweigh these, so I’m still sure that this is a good idea.

Closing words

And so ends another great year, with lots of great stuff happening on the programming front. If 2015 will be anything like 2014, I’d be totally happy :)

So I wish you all happy holidays a happy and healthy 2015!

 

Read More

Small update to the Delphi/Pascal OpenGL Header

Due to some user feedback, I’ve updated our delphi/pascal OpenGL header translation.

You can get it over at the bitbucket repository, and now finally with a proper markdown readme 😉

The changes include fixed type declarations for boolean types (so you can now finally write glDepthMask(GL_FALSE)), and some fixes for exception handling on 64-bit windows platforms.

Read More

Javascript repository

Following Java (on Android) and C++ (on Windows), I just released my first Javascript sources over at my bitbucket repository. My first (ever) public JavaScript demo is the random dungeon generator that I wrote an article about (a long time ago).

It generates rarnddungeon06ndom dungeons of different sizes and can be tested directly in your browser over here.
Included are the JavaScript sources for the random dungeon generator that use HTML5 for drawing a simple representation of the randomly generated rooms and corridors.

My plan now is to add some more randomness, some game-related features and to write a WebGL-renderer, so you can walk the dungeons in your browser, with maybe a game to follow.

Read More

Delphi/Pascal OpenGL Header now supports OpenGL 4.5

With OpenGL 4.5 being released (and NVidia already having drivers out in the wild) I’ve updated our Delphi/Pascal OpenGL Header translation to the latest OpenGL version.

You can always grab the most recent header translation from the bitbucket repository, where you’ll also find updates aside from the major OpenGL releases.

If you’re missing anything from the headers, like a vendor specific extension missing, or want to give feedback just drop me a line. I’d also be interested in feedback from developers that own OpenGL 4.5 compatible hardware, as my ATI Radeon HD6850 doesn’t support OpenGL 4.5 (yet, at least I hope so 😉 ).

And btw. : The OpenGL hardware database was mentioned (again) in the OpenGL BOF presentation at this years SIGGRAPH, so please keep contributing your OpenGL reports so all OpenGL devs out there can make good use of it.

Read More