DGL
https://delphigl.com/forum/

fragment shader question
https://delphigl.com/forum/viewtopic.php?f=19&t=3868
Seite 1 von 1

Autor:  cragwolf [ Mi Mär 02, 2005 00:09 ]
Betreff des Beitrags:  fragment shader question

I have good knowledge of OpenGL but not of the shaders or any shading language. I looked at this tutorial:

http://www.delphigl.com/script/do_show. ... g&action=2

Because my knowledge of German is non-existent, I used babelfish to translate it to English but I found the result less comprehensible then the original German. :lol: What really, really intrigues me about this article are the following two screenshots:

Bild

Bild

It seems to be saying that you have a colour-index texture (the first image), and then 3 other textures (grass, sand water), and then you use a shader to blend the 3 textures according to what is the colour-index (or combination of colour indexes, which produces nice blending). The result is the second image.

I would love to see this implemented with some Delphi or FreePascal code. The example could be very simple, no complex geometry, just a single quad. Because this is just the sort of thing that would be useful in a game which lets users create their own levels. With this technology, a user could colour an image with three colours, red, green and blue, each colour representing a different texture and ground type. The game would then use this image directly to produce the sort of multitextured scene you see in the second image above. That's beautiful!

So who is generous and talented enough to create such an example? I think a lot of people will be grateful for it.

Autor:  Stucuk [ Mi Mär 02, 2005 06:59 ]
Betreff des Beitrags: 

"Source Code is worth a thousand words"

If all the tutorials had working examples it would be good.

Autor:  La Boda [ Mi Mär 02, 2005 15:07 ]
Betreff des Beitrags: 

I quickly built a program, and again, I learned something :P
http://laboda.delphigl.com/morph.rar
The Performance is very low, and I think, with optimizations it wont be very much better...

EDIT: Argh, forgot the Source... updated

Autor:  luketheduke [ Mi Mär 02, 2005 16:35 ]
Betreff des Beitrags: 

somehow i can't get it downloaded....

could you check if it's a proper rar-archive?

it has got about 620 kB, after having downloaded it. is it the right size?

EDIT: works now. I'll just try it out.

Autor:  cragwolf [ Mi Mär 02, 2005 23:22 ]
Betreff des Beitrags: 

Hey thanks!

When I ran the program it crashed immediately, no indication of what the error was (just something at address 00000000). Do I need to download something extra, some DLLs, or what?

Edit: Oops, I forgot about the registry hack. My main system is Linux and I haven't updated the NVidia drivers for my Windows system in over a year! :oops:

Update: The program works very well. It runs at almost 500 FPS on my NVidia FX 5700.

Autor:  LarsMiddendorf [ Mi Mär 02, 2005 23:39 ]
Betreff des Beitrags: 

Perhaps your card doesn't support glsl and the program doesn't check the extensions.

Autor:  cragwolf [ Mi Mär 02, 2005 23:50 ]
Betreff des Beitrags: 

Thanks very much again. OK, finally, now I can started in GLSL!

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/