Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - JeGX

Pages: 1 [2] 3 4 ... 20
21
English forum / GPU buffers
« on: June 23, 2014, 03:31:33 PM »
GPU buffers are a powerful new feature of GLSL Hacker 0.7.0+. A GPU buffer is a wrapper around OpenGL hardware buffer objects. You can easily create an uniform or shader storage buffer, set values and use the buffer in a GLSL shader.

Here is a code snippet (in Lua) that illustrates how to use GPU buffers functions of the new gh_gpu_buffer lib:

Code: [Select]
storage_size = 32 -- memory size in bytes for two vec4
flags = ""
ssbo = gh_gpu_buffer.create("SHADER_STORAGE", "GL_DYNAMIC_READ", storage_size, flags)
gh_gpu_buffer.bind(ssbo)

gh_gpu_buffer.map(ssbo)

buffer_offset_bytes = 0
gh_gpu_buffer.set_value_4f(ssbo, buffer_offset_bytes, x0, y0, z0, w0)

buffer_offset_bytes = buffer_offset_bytes + 16
gh_gpu_buffer.set_value_4f(ssbo, buffer_offset_bytes, x1, y1, z1, w1)

gh_gpu_buffer.unmap(ssbo)

gh_gpu_buffer.unbind(ssbo)

binding_point_index = 3
gh_gpu_buffer.bind_base(ssbo, binding_point_index)


More complete examples are available in the code sample pack:

- host_api/gl-310-arb-uniform-buffer/
- host_api/gl-420-arb-atomic_counters/
- host_api/gl-430-arb-shader-storage-buffer-object/
- host_api/gl-440-arb-bindless-texture/

All these code samples use GPU buffers to share data with GLSL programs.

22
English forum / User plugins in C/C++
« on: June 23, 2014, 03:04:35 PM »
GLSL Hacker 0.7.0+ brings the support of user plugins (or dynamic/shared libs: *.dll under Windows, *.so under Linux and *.dylib under OS X). These dynamic libraries must implement the following functions:

Code: [Select]
int gxl_dylib_start(void* render_window, int width, int height, const char* data, void* user_data);
int gxl_dylib_stop(const char* data, void* user_data);
int gxl_dylib_frame(float elapsed_time, const char* data, void* user_data);
int gxl_dylib_resize(int width, int height, const char* data, void* user_data);
int gxl_dylib_set_message(const char* message);
char* gxl_dylib_get_message();


render_window is a pointer on the following data structure:
Code: [Select]
struct RenderWindowData_v1
{
#if _WINDOWS 
  HDC _dc; // Device context.
  HWND _hwnd; // Handle on the 3D window.
  HGLRC _glrc; // OpenGL context.
#endif

#if _OSX
  void* _glrc; // OpenGL context.
#endif

#if _LINUX
  Display* _display; // not set, alwyas = 0
  Window _window; // not set, alwyas = 0
  void* _glrc; // OpenGL context.
#endif
};

Once your DLL is coded with these functions, you can load it and use it in GLSL Hacker:

INIT script:
Code: [Select]
dlib = gh_utils.dylib_load(dylib_filename)
plugin_data = ""
gh_utils.dylib_start(dlib, winW, winH, plugin_data)



FRAME script :
Code: [Select]
plugin_data = ""
gh_utils.dylib_frame(dlib, elapsed_time, plugin_data)


SIZE script :
Code: [Select]
winW, winH = gh_window.getsize(0)
plugin_data = ""
gh_utils.dylib_resize(dlib, winW, winH, plugin_data)


TERMINATE script :
Code: [Select]
plugin_data = ""
gh_utils.dylib_stop(dlib, plugin_data)
gh_utils.dylib_unload(dlib)

You can use the plugin_data variable to pass arbitrary string to the plugin.

A complete demo (including the DLL source code in C/C++ for Windows and OS X) is available in the host_api/User_Plugin/ folder of the code sample pack.

This demo initializes and draws a simple triangle:





23
Forum en français / Plugin utilisateur en C/C++
« on: June 23, 2014, 02:52:22 PM »
GLSL Hacker 0.7.0+ apporte le support des plugins ou DLLs utilisateurs. Ces librairies dynamiques doivent implémenter les fonctions suivantes:

Code: [Select]
int gxl_dylib_start(void* render_window, int width, int height, const char* data, void* user_data);
int gxl_dylib_stop(const char* data, void* user_data);
int gxl_dylib_frame(float elapsed_time, const char* data, void* user_data);
int gxl_dylib_resize(int width, int height, const char* data, void* user_data);
int gxl_dylib_set_message(const char* message);
char* gxl_dylib_get_message();

render_window pointe sur la structure suivante:

Code: [Select]
struct RenderWindowData_v1
{
#if _WINDOWS 
  HDC _dc; // Device context.
  HWND _hwnd; // Handle on the 3D window.
  HGLRC _glrc; // OpenGL context.
#endif

#if _OSX
  void* _glrc; // OpenGL context.
#endif

#if _LINUX
  Display* _display; // not set, alwyas = 0
  Window _window; // not set, alwyas = 0
  void* _glrc; // OpenGL context.
#endif
};

Une fois que vous avez codé votre DLL avec ces fonctions, il suffit de la charger dans GLSL Hacker avec gh_utils.dylib_load():

Script INIT:
Code: [Select]
dlib = gh_utils.dylib_load(dylib_filename)
plugin_data = ""
gh_utils.dylib_start(dlib, winW, winH, plugin_data)

Il ne reste plus qu'à appeller les fonctions start, frame, resize, etc.

Script FRAME:
Code: [Select]
plugin_data = ""
gh_utils.dylib_frame(dlib, elapsed_time, plugin_data)

Script SIZE:
Code: [Select]
winW, winH = gh_window.getsize(0)
plugin_data = ""
gh_utils.dylib_resize(dlib, winW, winH, plugin_data)


Script TERMINATE:
Code: [Select]
plugin_data = ""
gh_utils.dylib_stop(dlib, plugin_data)
gh_utils.dylib_unload(dlib)


La variable plugin_data permet de transmettre une chaine de caractères au plugin. Cette chaine de caractères vous permet d'envoyer des informations quelconques au plugin.

Une demo complete (avec les codes sources de la DLL pour Windows et OS X) est disponible dans le code sample pack dans le répertoire
host_api/User_Plugin/

Cette demo charge un plugin C++/OpenGL tout simple qui initialise et dessine un triangle:



24
Forum en français / Fenetres transparentes sous Mac OS X
« on: June 23, 2014, 02:18:19 PM »
La version 0.6.4.5 de GLSL Hacker apporte le support des fenetres transparentes sous OS X. Par default une fenetre est totalement opaque. Pour faire une fenetre transparente, il suffit de changer sa valeur alpha dans le noeud XML scene:

Code: [Select]
<window name="win3d01" title="3DS loading"
                 width="800" height="600" alpha="0.6"
                gl_version_major="3" gl_version_minor="2" />

Si alpha=1.0, la fenetre est totalement opaque, si alpha=0.0, la fenetre est totalement transparente.


25
English forum / Transparent windows under Mac OS X
« on: June 23, 2014, 02:14:29 PM »
The version 0.6.4.5 of GLSL Hacker brings the support of transparent windows under Mac OS X. By default a window is fully opaque. To make a transparent window, just set its alpha value in the XML window node:

Code: [Select]
<window name="win3d01" title="3DS loading"
                 width="800" height="600" alpha="0.6"
                gl_version_major="3" gl_version_minor="2" />

if alpha=1.0, the window is fully opaque, if alpha=0.0, the window is fully transparent.


26
Forum en français / Le plugin FreeImage (GLSL Hacker 0.6.4.3+)
« on: June 23, 2014, 02:06:40 PM »
Depuis la version 0.6.4.3, GLSL Hacker est dispo avec un nouveau plugin pour charger les images. Ce plugin est basé sur FreeImage, une puissante librairie de manipulation d'images. Elle supporte des tonnes de formats ainsi que les formats HDR (128-bit par pixel ou 4 float par pixel).

GLSL Hacker intègre depuisle début un plugin basé sur la lib stb pour charger les images. La question est: comment sélectionner le plugin qui sera utilisé pour charger les images?

La réponse à cette question est toute simple: il faut utiliser la fonction set_current_image_codec() de la lib gh_texture:

Code: [Select]
gh_texture.set_current_image_codec(nom_du loader)

Pour utiliser le plugin FreeImage:
Code: [Select]
gh_texture.set_current_image_codec("FreeImage")

Maintenant toutes les fonctions de chargement d'images utiliseront le plugin FreeImage.

Pour revenir au plugin intégré:
Code: [Select]
gh_texture.set_current_image_codec("stb")

27
English forum / FreeImage plugin (GLSL Hacker 0.6.4.3+)
« on: June 23, 2014, 01:59:16 PM »
From the version 0.6.4.3, GLSL Hacker is shipped with a new image loader plugin based on the popular FreeImage library. FreeImage is a powerful library to manage images and supports a lot of formats as well as 128-bit formats (each channel is coded on a float). But GLSL Hacker comes already with a built-in image loader (based on STB). So the question: how to choose the image loader?

This simple question has a simple answer: the set_current_image_codec() function of gh_texture lib:

Code: [Select]
gh_texture.set_current_image_codec(plugin_name)

To use the FreeImage loader, just do:
Code: [Select]
gh_texture.set_current_image_codec("FreeImage")

Now all texture functions that load an image file will use the FreeImage plugin.

To use the default image loader:
Code: [Select]
gh_texture.set_current_image_codec("stb")

28
Quote
So, today’s rumor, about the GeForce GTX 880 and GTX 870 are clearly feeding off of this desire for information and likely enlighten when and what we can expect to see from Nvidia. The first and foremost important detail is that their sources claim that the GeForce GTX 880 and GTX 870 will be launching in the fourth quarter of 2014, most likely in October or November. This would give Nvidia ample time to prepare for the fall/winter game release rush and to have a new and exciting product for the holiday season.

Link: http://www.brightsideofnews.com/2014/06/17/new-geforce-gtx-880-gtx-870-details-leak/

29
English forum / (WIP) Particle simulator with GL 4.3 compute shaders
« on: June 18, 2014, 01:10:42 PM »
Based on the same code than the particle painter, here are some screenshots of a particle simulator. Around 200'000 particles + 8 attractors are processed by a compute shader (OpenGL 4.3).




30
English forum / (WIP) Particle Painting, Compute Shader + SSBO
« on: June 17, 2014, 10:34:56 PM »
After some hacking and tweaking on a particle simulator (I tool the original code from the OpenGL Programming Guide 8th Edition), I ended up with this unwanted particle painter. Particles are stored on a SSBO and processed by a compute shader.




31
English forum / GLSL Hacker 0.6.4.4
« on: June 04, 2014, 03:32:46 PM »
A new dev version of GLSL Hacker is ready for Windows 64-bit.

You can download it from this page:
http://www.geeks3d.com/glslhacker/download.php

Changelog:
Quote
Version 0.6.4.4 - 2014.06.04
-----------------------------
! updated the OpenGL context creation under Windows and Linux for when
  the required major version is 2.
+ added create_ex_v3() to gh_render_target lib.
+ added uniform_camera_matrices() and uniform_object_matrix() to gh_gpu_program lib.

GLSL Hacker 0.6.4.4 adds new functions used in my deferred rendering tests.

32
English forum / (WIP) Deferred rendering test
« on: May 29, 2014, 09:30:22 PM »
I took some time this afternoon to play a bit with deferred rendering. The last screenshot shows 200 dynamic lights.









33
Quote
MSI, world leading in motherboard technology, is pleased to announce its unleashing of the Z97 GAMING 9 AC motherboard to the public. The Z97 GAMING 9 AC from MSI is a custom designed motherboard, decorated with luscious new heat-sinks and unique Dragon Armor that highlight an arsenal of new features found on the board. It's masterpiece being Xtreme Audio DAC, a premium dedicated onboard sound card with specially selected high quality audio components, set up and tuned by professionals delivering 120dB Signal-to-Noise-Ratio (SNR) 192kHz / 32-Bit of purest sound quality for studio-grade Hi-Fi solutions and gaming headgear. The MSI Z97 GAMING 9 AC also comes with an Intel® Wi-Fi AC module with Bluetooth 4.0 and Intel® WiDi support.

Press release: http://msi.com/news/1744.html



34
Quote
The GTX 780 model has double memory: 6GB, while both have 10-phase power design that reduces power noise by 30% and increases efficiency by 15% versus reference designs. The cards are built with DIGI+ VRM and hard-wearing POSCAPs, while the DirectCU-like cooler has been upgraded with ’0dB technology’. When the GPU temp is below 65C the card will run in passive mode with the fans turned off. The large heatsink works to efficiently absorb and dissipate the minimal heat generated by low loads, so while you’re surfing the internet, watching videos, playing light games – your graphics card won’t make a sound.

Link: http://rog.asus.com/323792014/gaming-graphics-cards-2/asus-announces-strix-r9-280-3gb-and-strix-gtx-780-6gb-gaming-graphics-cards-with-0db-fan-tech/


35
English forum / GLSL Hacker 0.6.4.3
« on: May 28, 2014, 01:45:59 PM »
A new dev version of GLSL Hacker is ready but only for Windows.

You can download it from this page:
http://www.geeks3d.com/glslhacker/download.php

Changelog:
Quote
Version 0.6.4.3 - 2014.05.28
-----------------------------
* fixed a bug in gh_mesh.set_vertices_color() in Lua.
+ added set_vertices_color() to gh_mesh in Python.
+ added mouse_get_wheel_delta() to gh_input lib.
+ added new keyboard keys support (shift, ctrl, alt and windows key).
+ added keyboard_codes.lua in GLSL Hacker Lua libs folder.
+ added FreeImage plugin with floating point (96 and 128-bit) support.
+ added set_current_image_codec_name() to gh_texture module.

GLSL Hacker 0.6.4.3 adds a new image loader plugin based on FreeImage. To use this plugin, just specify it before loading a texture:

Code: [Select]
gh_texture.set_current_image_codec_name("FreeImage")

tex = gh_texture.create_from_file(...)

If the FreeImage plugin is not present, GLSL Hacker uses the built-in image loader.


36
English forum / GLSL Transitions
« on: May 24, 2014, 05:16:49 PM »
The  code sample pack has been updated with some cool GLSL transitions intrroduced in this article:

http://www.geeks3d.com/20140524/glsl-io-a-helpful-collection-of-glsl-transition-effects/

GLSL transitions demos are available in the host_api/GLSL_Transitions/ folder of the code sample pack.









 

37
Quote
Vendor A has “the most capable GL devs in the industry and the best testing process.” It focuses on OpenGL implementations that work rather than on spec purity. It’s sexy. It’s fun. It’s also the vendor that’s pushing OpenGL as an alternative to Mantle or D3D12.

...this vendor (vendor A) will do things like internally replace entire shaders for key titles to make them perform better (sometimes much better). Most drivers probably do stuff like this occasionally, but this vendor will stop at nothing for performance.

Next up, Vendor B. Vendor B knows the OpenGL spec inside and out and focuses on implementing OpenGL correctly. Unfortunately, Vendor B is characterized as being “a complete hodgepodge, inconsistent performance, very buggy, inconsistent regression testing [and] dysfunctional driver threading…

And Vendor C? Vendor C has two major driver development teams, but doesn’t focus on graphics and is years behind Vendors A and B in implementing basic OpenGL features. It leads the way in open source graphics drivers, and has (mostly) public hardware specs. One driver is years behind but mostly stable as long as you don’t care about performance or features, while the other team’s driver is “a complete disaster…

Vendor A = NVIDIA
Vendor B = AMD
Vendor C = Intel

Complete story:  http://richg42.blogspot.co.uk/2014/05/the-truth-on-opengl-driver-quality.html

Via: http://www.extremetech.com/gaming/182343-why-we-cant-have-nice-things-valve-programmer-discusses-wretched-state-of-opengl

38
Forum en français / Filtre de post processing: Toonify
« on: May 24, 2014, 10:03:25 AM »
Voici un petit filtre GLSL sympa qui permet de toonifier ou cartooniser une image:

http://www.geeks3d.com/20140523/glsl-shader-library-toonify-post-processing-filter/




Pages: 1 [2] 3 4 ... 20