Geometry Shaders for Irrlicht(development closed till later)

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

doesn't compile on my gpu...you have a video?
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
vectorcorpse
Posts: 86
Joined: Thu Feb 14, 2008 7:30 pm
Location: Portugal

Post by vectorcorpse »

AMD Athlon 64 x2 4800+ skt939
2Gb ddr1 dual channel
saphire ATI radeon HD4850
on ubuntu 9.10
  • Welcome to the irrlicht example number 24
    "Geometry Shaders" which will show you
    the capabilities of irrlicht's shaders in
    addition to relief mapping
    Irrlicht Engine version 1.7.1
    Linux 2.6.31-20-generic #57-Ubuntu SMP Mon Feb 8 09:02:26 UTC 2010 x86_64
    Creating X window...
    Visual chosen: : 41
    Using renderer: OpenGL 3.2.9551
    ATI Radeon HD 4800 Series: ATI Technologies Inc.
    OpenGL driver version is 1.2 or better.
    GLSL version: 1.5
    Reading material file: room_tesselation.mtl
    Could not open material file: room_tesselation.mtl
    Loaded material start: _--_default_--
    Loaded smoothing group start: 1
    Loaded smoothing group start: off
    Loaded smoothing group start: 1
    Loaded smoothing group start: off
    Loaded smoothing group start: 1
    Loaded mesh: ../../media/room_tesselation.obj
    Loaded texture: /home/ricardo/dev/irrlicht-1.7.1/media/rockwall_height.bmp
    Loaded texture: /home/ricardo/dev/irrlicht-1.7.1/media/rockwall.jpg
    GLSL shader failed to compile
    Geometry shader failed to compile with the following errors:
    ERROR: 0:78: error(#132) Syntax error: '}' parse error
    ERROR: error(#273) 1 compilation errors. No code generated
this is a really strange error since on line 78 the '}' looks fine to me
btw: u didn't include the material file for the room model in the zip file
vectorcorpse
Posts: 86
Joined: Thu Feb 14, 2008 7:30 pm
Location: Portugal

Post by vectorcorpse »

for those who want something more visual u can see tessellation working on unigine with and without
http://www.youtube.com/watch?v=bkKtY2G3FbU
and here the full demo
http://www.youtube.com/watch?v=9F6zSgtRnkE
this is good for a big range of machine in a game support
u can have a low polly model for older cards and for the newer cards u can add geometry detail using mapping in a similar way that we do with parallax but instead of moving lights u add triangles
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

Wooo this is nice!
For people who can't compile it, I'm going to upload a video.
Just wait 1h40 more and it will be ready...

By the way, nice work ;)
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

http://www.youtube.com/watch?v=fEC0WAF2NIg

I can see that tessellation is useful for example for the flag and water but I don't see any real advantage on the crowd though... doesn't look any better.

anyway unigine's demo is really cool i like that.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

stefbuet, you got this example to compile? Neither my Mac nor my PC with ATI HD card could compile it. I'll try next week on a nv 8800, but don't know if it supports geometry shaders...
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

hybrid wrote:stefbuet, you got this example to compile? Neither my Mac nor my PC with ATI HD card could compile it. I'll try next week on a nv 8800, but don't know if it supports geometry shaders...
Each graphic card compatible with DX 10 (so GF8800 also) support GS also in OGL, only problem will be performance...
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

Here is the video:
http://www.youtube.com/watch?v=zMMXvjlZ_s8

You can see the room with a lot lot of tesselletion at 1:48
And it's rendered on a GeForce GTX 260
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, neither the Intel card (which exposed the geometry shader4 extension) nor the ATI card did compile the shader. So I'll put my hopes on the nvidia compiler...
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

As the mesh used in the demo wasn't so great, I used another one which is really cool with the heightmap. It's like in the previous post about Heaven engine with the paved roads demo.

Here is a little screen shot:
Image

Wireframe:
Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Did you use the same geom shader? Could you provide the mesh, we'd like to add a new example for geometry shaders. And this example looks exactly like what we want :D
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

I used the same shaders.
I just changed some few things:
-added return(false) to the event receiver
-commented the GUI window creation, because when deleted, the screen was darker than what it should be... Idk why.
-changed default parameters to make the whole thing cool as soon as you execute the demo (wireframe desabled, ...)

The mesh is a plane create in 3dsmax (.max in archive) with 6*6 subdivisions, and tex coords.
The texture and heightmap are from http://www.filterforge.com/filters/
(I also photoshoped a little the heightmap to make it woking better)

Here is the archive with sources, assets and binary (without irr 1.7.1 dll):
http://dl.free.fr/aCJCEmUXG
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

when i try to run the example 24 i get this in the console

Code: Select all

Welcome to the irrlicht example number 24
"Geometry Shaders" which will show you
the capabilities of irrlicht's shaders in
addition to relief mapping
Irrlicht Engine version 1.7.1
Linux 2.6.31-19-generic #56-Ubuntu SMP Thu Jan 28 02:39:34 UTC 2010 x86_64
Creating X window...
Visual chosen: : 39
Using renderer: OpenGL 3.0.0
GeForce 8600M GT/PCI/SSE2: NVIDIA Corporation
OpenGL driver version is 1.2 or better.
GLSL version: 1.3
Could not load mesh, because file could not be opened: : ../../media/room_tesselation.obj
GLSL shader failed to compile
0(180) : error C7532: global function min requires "#version 130" or later

Segmentation fault
PS: i tried the nvidia demo about openGl tessalation and it worked so i guess its not my videocard?!
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

stefbuet your demo looks cool.[/quote]
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

nice job at presenting my idea :)

If I manage to get some more free time, I will work on a version which doesn't have these ugly holes between LoD levels (I didn't have adjacency info).

Also add Parallax Occlusion mapping to the demo on top of the tesselation

also there can be one more example of this feature, phong tesselation, subdivides mesh only on edges to the screen to achieve e.g. a pixel perfect round ball. Again I could write it, with some time.

Image

this is not so much of a FPS killer as normal tesselation, meaning it actually has a use on dx10 hardware.
Post Reply