HLSL shaders

General discussion about the development of the open source Blender

Moderators: jesterKing, stiv

rstralberg
Posts: 0
Joined: Wed Jul 21, 2004 4:48 pm
Location: Sweden

HLSL shaders

Post by rstralberg » Wed Jul 21, 2004 4:54 pm

Are there any plans for implementation of HLSL shaders in Blender?

shadowman99
Posts: 6
Joined: Wed Oct 16, 2002 3:14 am

Post by shadowman99 » Wed Jul 21, 2004 9:44 pm

Somebody correct me if I'm mistaken - HLSL is for Windows and Direct X, and Blender runs on many platforms that MS does not support with Direct X.

jesterKing
Site Admin
Posts: 207
Joined: Fri Oct 18, 2002 12:48 pm
Location: Finland

Post by jesterKing » Wed Jul 21, 2004 11:32 pm

In tuhopuu gameengine you can find support for GLSL shaders.

(http://projects.blender.org/viewcvs/vie ... ot=tuhopuu)

/jesterKing

rstralberg
Posts: 0
Joined: Wed Jul 21, 2004 4:48 pm
Location: Sweden

Post by rstralberg » Wed Jul 21, 2004 11:42 pm

Shaders may be implemented i openGL also using
OpenGL® Shading Language

Here is a quote from http://www.theregister.co.uk/2003/07/01 ... ces_opengl
The HLSL was approved by the OpenGL Architecture Review Board, the standard's governing body, on 11 June and is likely to form the basis for OpenGL 2.0, the next major revision of the open graphics API.
More ...

http://www.opengl.org/documentation/oglsl.html

http://www.theregister.co.uk/2003/07/01 ... ces_opengl

alien-xmp
Posts: 0
Joined: Sun Apr 06, 2003 2:22 pm
Location: Wellington, New Zealand
Contact:

Post by alien-xmp » Thu Jul 22, 2004 4:22 am

You can use GLSL in tuhopuu2.

Check out the PyDoc stuff for how to load your shader, and how to set uniforms, etc.

rstralberg
Posts: 0
Joined: Wed Jul 21, 2004 4:48 pm
Location: Sweden

Post by rstralberg » Thu Jul 22, 2004 11:09 am

Many thank's JesterKing and alien-xmp, I will check that.

Panther
Posts: 0
Joined: Tue Mar 04, 2003 7:55 pm

Post by Panther » Thu Jul 22, 2004 2:02 pm

You can use GLSL in tuhopuu2.
Excellent work Kester... this could be very promising indeed !!! :D

Quick question though...

Won't this kill / hinder the performance of the game engine to some degree ???

For example, the game engine isn't known for its speed ( no offence intended ), so wouldn't GLSL bring it down even more ???

On a side note...

Great news about the 'Shadow' support in the game engine, all of your work in this field is greatly appreciated !!! :)

Take care,

Panther
Last edited by Panther on Thu Jul 22, 2004 8:08 pm, edited 1 time in total.

alien-xmp
Posts: 0
Joined: Sun Apr 06, 2003 2:22 pm
Location: Wellington, New Zealand
Contact:

Post by alien-xmp » Thu Jul 22, 2004 2:44 pm

Won't this kill / hinder the performance of the game engine to some degree ???
It really depends on the graphics card. I test with a Radeon 9800XT and a GeForce FXGo5200. The Radeon loves it, it barely misses a step. The FX5200 does get killed. :twisted: The FX5200 just doesn't have the fill rate, the speed is proportional to the size of the object being shaded.

Also, vertex buffer objects and display lists are in Tuhopuu2.

Also also, gcc generates faster code than MSVC (~33%)

Put these together, and I'm getting around 60fps with 100k onscreen quads. This is of course static geometry, deformed objects such as armatures and zsorted objects and the rest of the game will slow you down.

IoN_PuLse
Posts: 212
Joined: Wed Oct 16, 2002 6:05 am
Location: Canada, BC
Contact:

Post by IoN_PuLse » Thu Jul 22, 2004 4:37 pm

alien-xmp wrote: It really depends on the graphics card. I test with a Radeon 9800XT and a GeForce FXGo5200. The Radeon loves it, it barely misses a step. The FX5200 does get killed. :twisted: The FX5200 just doesn't have the fill rate, the speed is proportional to the size of the object being shaded.
There is a BIG difference between those two cards, especially in price. I hope you didn't mean it as a direct comparison of nvidia vs ati.

Which driver versions were you using for each as well?
alien-xmp wrote: Also also, gcc generates faster code than MSVC (~33%)
Do you have proof of this? I've read nothing but article after article stating the opposite.

Panther
Posts: 0
Joined: Tue Mar 04, 2003 7:55 pm

Post by Panther » Thu Jul 22, 2004 8:17 pm

It really depends on the graphics card. I test with a Radeon 9800XT and a GeForce FXGo5200. The Radeon loves it, it barely misses a step. The FX5200 does get killed.
ATI giving better OpenGL performance than NVIDIA... I never thought I'd see the day !!! :wink:

I'm using a standard ( not 'Go' ) 128MB GeForceFX 5200, what do you think my chances are of getting 60FPS performing a similar test to you - Good / bad ???
gcc generates faster code than MSVC (~33%)
Interesting... is that documented somewhere / do all the developers know that ??? :?

I know we're speaking about Tuhopuu here, but does anyone know which compiler is used to generate all the 'Official' BF releases ???

SirDude
Posts: 233
Joined: Sun Oct 13, 2002 7:37 pm
Location: University of Minnesota (USA)
Contact:

Post by SirDude » Thu Jul 22, 2004 8:45 pm

I'm pretty sure everything execpt for Windows is compiled with gcc currently for the offical builds.

Panther
Posts: 0
Joined: Tue Mar 04, 2003 7:55 pm

Post by Panther » Thu Jul 22, 2004 9:08 pm

Thanks for the fast response SirDude !!! :)

alien-xmp
Posts: 0
Joined: Sun Apr 06, 2003 2:22 pm
Location: Wellington, New Zealand
Contact:

Post by alien-xmp » Fri Jul 23, 2004 12:31 am

IoN_PuLse wrote:
alien-xmp wrote: It really depends on the graphics card. I test with a Radeon 9800XT and a GeForce FXGo5200. The Radeon loves it, it barely misses a step. The FX5200 does get killed. :twisted: The FX5200 just doesn't have the fill rate, the speed is proportional to the size of the object being shaded.
There is a BIG difference between those two cards, especially in price. I hope you didn't mean it as a direct comparison of nvidia vs ati.

Which driver versions were you using for each as well?
Yeah I know. One of the nvidia papers showed a similar performance jump between the 5200 and their high end models. The FX cards also have a nicer shader engine (longer shaders, dFdx works.) The FX is also running at 1600x1200, while the ATI is at 1024x768, which is 240% more pixels to shade.

I mostly test driver 61.06 on Linux, and occaisionally use 61.76 on Windows. The ATI is on Catalyst 4.6. (Not the latest, but it will take me all day to download the next revision.)
IoN_PuLse wrote:
alien-xmp wrote: Also also, gcc generates faster code than MSVC (~33%)
Do you have proof of this? I've read nothing but article after article stating the opposite.
I know, I was quite surprised when I saw it, and I only compiled with gcc because I was helping someone on IRC. I'm basing it on game framerates:
Ballercoaster: MSVC: ~120fps, gcc: ~160fps
55Wheels: MSVC: ~30fps, gcc: ~40fps

MSVC extra compiler flags: /Og /Oip /GR
GCC extra compiler flags: -O2 -ffast-math

theeth
Posts: 500
Joined: Wed Oct 16, 2002 5:47 am
Location: Montreal
Contact:

Post by theeth » Fri Jul 23, 2004 12:34 am

alien-xmp wrote:
IoN_PuLse wrote:
alien-xmp wrote: Also also, gcc generates faster code than MSVC (~33%)
Do you have proof of this? I've read nothing but article after article stating the opposite.
I know, I was quite surprised when I saw it, and I only compiled with gcc because I was helping someone on IRC. I'm basing it on game framerates:
Ballercoaster: MSVC: ~120fps, gcc: ~160fps
55Wheels: MSVC: ~30fps, gcc: ~40fps

MSVC extra compiler flags: /Og /Oip /GR
GCC extra compiler flags: -O2 -ffast-math
Since the game engine is mostly C++, could it be that this speed increase is limited to C++ code for whatever reason? Because for the rest of blender, I've heard quite the opposite.

Martin
Life is what happens to you when you're busy making other plans.
- John Lennon

IoN_PuLse
Posts: 212
Joined: Wed Oct 16, 2002 6:05 am
Location: Canada, BC
Contact:

Post by IoN_PuLse » Fri Jul 23, 2004 7:33 pm

So this is really a comparison of GCC for windows and MSVC?

Post Reply