What's new

Pixel Shader Programming

mudlord

Banned
Hello peeps!


Here's something I've been working on for sometime.

To better acquaint myself with Direct3D and graphics programming in general, I have been writing this.

For the interested people, its a simple app that will apply HLSL-format pixel shaders to a image. It uses DirectX9. so you need a fully compliant video card that supports pixel shaders (some shaders in the pack I wrote uses Shader Model 2.0).

This might be interesting, and feel free to experiment with the shaders in here, if you want to write your own.

That said, n'joy <3

Note: The app itself is incomplete, and message handling for the dialogs is a bit kludgy (will crash if you press "Cancel" at any of the "open" dialogs)
 

xtra krazzy

Dolphin Developer
The emboss shader is pretty cool. Other than that: I think that the DXSDK contains a similar program which pastes the image on a sphere and lets you browse with their DX GUI framework.
 
OP
mudlord

mudlord

Banned
I think that the DXSDK contains a similar program which pastes the image on a sphere and lets you browse with their DX GUI framework.

Quite true, it shades the model instead of a D3D surface.

I'm glad you like the shader! ^.^

My next version of this is going to use hardware framebuffers for post processing, to help speed up rendering, as well as a experiment for some things I have planned....:matrix:

As well as fixing those message handling things and add a proper GUI.
 

xtra krazzy

Dolphin Developer
The program, itself, could be useful.

Just make a loop/GUI so that people shouldn't close the entire program and reopen each time they want to switch a shader :p
 
OP
mudlord

mudlord

Banned
ust make a loop/GUI so that people shouldn't close the entire program and reopen each time they want to switch a shader

Thats exactly I was intending to do :king:
 
OP
mudlord

mudlord

Banned
Well, I got hold up with some real life things atm, so my dev projects are currently on hold. I do intend to rewrite the whole thing, since I developed my own private C/C++ Win32 framework for applications, and this new version will use it. Mainly my framework is a nice and very lean template for Win32 applications, and is multithreaded.
 

xtra krazzy

Dolphin Developer
Building a framework is complicated... Try changing the term to "toolkit" and release as open-source? :)

Toolkit - A set of generic tools, for use in various programs. Toolkits are extensible and provide solutions to problems or ease-of-use. Programmers can program into the toolkit. Like Java's AWT/Swing (I guess).

Framework - A huge set of tools, capable of stand-alone mode. [blah blah provides solutions]. Programmers can only extend its main classes, without knowing what's inside. Like .NET

Anyway... Nice idea for a private development :p
 
OP
mudlord

mudlord

Banned
Yes, in your words its a "toolkit"

A nice and lean Win32 application toolkit. Written without MFC or .NET

I'd say its a nice idea too, saves me reinventing the wheel every single time I develop a application,. like my Glide wrapper compatibility tester and MD5/CRC/SHA-1 calculator...

I dunno if I am willing to go the open-source route. I can't stand the GNU GPL, so thats out of the question. If more than anything, it will be BSD or public domain.
 
Last edited:
OP
mudlord

mudlord

Banned
Release it as a DLL with interface documentation then Maybe programs like actor viewers will use it.

Sounds quite a nice idea. I've been pondering more over this, and what type of functions to add, apart from the usual Win32 things. I converted some of my other apps to this new toolkit, but its not in DLL form, yet...
 

Doomulation

?????????????????????????
Well, maybe you should start small with the functions that you specifically use, and then add more upon demand, or as you use more functions yourself. Or just add a little time by time.
I also have my own little project I've worked upon some time ago, but lately I've just done nothing to it. It's my own registry framework, which, though it isn't complete, I could lend and work together upon case you're interested.

My initial thoughts was an object-oriented approach to saving stuff in the registry without having to worry about what type of object you were saving or loading.
 
OP
mudlord

mudlord

Banned
Well, maybe you should start small with the functions that you specifically use, and then add more upon demand, or as you use more functions yourself. Or just add a little time by time.

Good idea. I was originally thinking of writing a helper library with the following things:

* Configuration file reading
* Checksum calculation
* XM/MOD/S3M/IT/Virusz 2 playback
* Standard set up routines for OpenGL/Direct3D applications
* Shader parsing routines for HLSL
* as well as my Win32 application template classes

So, if more than anything, it will turn into a helper DLL, as well as a toolkit.
 

Doomulation

?????????????????????????
Sounds nice. Now how about that custom registry? :p I know a lot of people do not want to use Windows Registry for some reasons and not to mention Windows API isn't very object oriented...
Still, you might even add it to your helper DLL, if it was finished sometime.
 

xtra krazzy

Dolphin Developer
I gave up on windows registry a long time ago and moved to INIs... Saves a lot of unnecessary time...
Now, if you have a registry framework, why not consider adding OO (object oriented) INI functionality? (I could program it, it's easy as hell and should take me no more than one day including debugging for all of the common datatypes)

Yay, Joint projects.
 
OP
mudlord

mudlord

Banned
why not consider adding OO (object oriented) INI functionality

Hm....I already wrote the INI loading/saving code, and its quite portable and quite a cinch to use. OO though, might come later.

The XM/S3M/IT/MOD code is done through a BASSMOD wrapper I plan to write, almost all other MOD playback engines have hideous sound issues (libmodplug, I'm looking at you...), and plus, the DLL can be embedded as a resource.

Virusz 2 playback is done through kb/farbrausch's libV2, which is very easy to use. And music is loaded in memory.


Other stuff is pretty straightforward too.

I might as well add the kitchen sink lol.....

EDIT: What I ported so far, which is not much. Hash algorithms are in there.
 
Last edited:

Doomulation

?????????????????????????
I gave up on windows registry a long time ago and moved to INIs... Saves a lot of unnecessary time...
Now, if you have a registry framework, why not consider adding OO (object oriented) INI functionality? (I could program it, it's easy as hell and should take me no more than one day including debugging for all of the common datatypes)

Yay, Joint projects.

It writes to a file since Windows registry is inadequate.
It writes not to INI files, but to another file. It's like a registry file - index and data files, not meant to be edited by hand. Making a user edit INI files is stupid I think. All options should be handled by GUI nowadays.
I did create an easy function to store/load all options in a dialog too, once. It stores data in the registry, but could be modified to save with the new registry system maybe.
 

xtra krazzy

Dolphin Developer
Hm....I already wrote the INI loading/saving code, and its quite portable and quite a cinch to use. OO though, might come later.

The XM/S3M/IT/MOD code is done through a BASSMOD wrapper I plan to write, almost all other MOD playback engines have hideous sound issues (libmodplug, I'm looking at you...), and plus, the DLL can be embedded as a resource.

Virusz 2 playback is done through kb/farbrausch's libV2, which is very easy to use. And music is loaded in memory.


Other stuff is pretty straightforward too.

I might as well add the kitchen sink lol.....

EDIT: What I ported so far, which is not much. Hash algorithms are in there.

Say, what about OGG Vorbis playback? It's more common than Virusz2 these days.

EDIT: Your CRC32 hashmaker reports 0x81D08732 on demo.exe while the zipped version is (according to WinRAR) 7E2F78CD... Could it be that WinRAR evaluates the compressed version of the file or yours is wrong?
 
Last edited:
OP
mudlord

mudlord

Banned
I found the problem in the CRC32 algorithm, I didnt put in reflection, which is needed for CRC32's which are compatible with WinZip/WinRAR/PKZip. I'm currently adding in this approach as I write this.

Say, what about OGG Vorbis playback? It's more common than Virusz2 these days

BASS can handle Vorbis fine. I might just use BASS instead of BASSMOD, plus then I can add SFX like reverb, distortion etc...Virusz2 is big in the demoscene tho...Most of farbrausch's demos use it in some form.
 

xtra krazzy

Dolphin Developer
I found the problem in the CRC32 algorithm, I didnt put in reflection, which is needed for CRC32's which are compatible with WinZip/WinRAR/PKZip.

Good, I'm glad I helped figuring this out before programs start using your toolkit.


I've seen BASS included in commercial apps (games) before... Worked well for OGGs IIRC. If you'll use/embed too many toolkits/DLLs created by other people, your toolkit could turn into a collection of other toolkits. (or, if agreed by creators, a whole new framework) Anyway, sound files are an exception, just like DX/OpenGL.

BTW, have you already programmed your own controller, which exports one simple function like PlaySoundFile(file, bAsync) and associates different file and mime types to different sets of functions, which are exported by BASS and other modules?
 

Top