- program Ambient
- shader basic.glsl
- shader ambient.glsl
- scene ambientduckie.scn
DGL https://delphigl.com/forum/ |
|
convert almost any shader to arb vertex and fragment shaders https://delphigl.com/forum/viewtopic.php?f=20&t=7207 |
Seite 1 von 1 |
Autor: | noeska [ Fr Jan 18, 2008 22:24 ] |
Betreff des Beitrags: | convert almost any shader to arb vertex and fragment shaders |
It is possible to convert almost any shader format to arb vertex and fragment shaders. This is possible with the ati ashli viewer available at: http://ati.amd.com/developer/ashli.html . It converts from: - Renderman Shaders - HLSL Shaders (directx) - GLSL Shaders (directx) to ARB vertex and ARB fragment shaders. At first i thought is was fixed to the examples supplied, but you can add your own scenes and shaders. For Renderman shaders you need to modify: ashliViewerListRMan.dat For GLSL Shaders you need to modify: ashliViewerListGLSL.dat For HLSL Shaders you need to modify: ashliViewerListHLSL.dat You will find these files in: C:\Program Files\ATI Technologies\Ashli Viewer 1.7.0\bin if you installed the ashli viewer in the default location. The format for adding your own scene is: Code:
The program is the entry in the treeview and the sader and scene are showed when click on the + in the treeview. Each program needs to be seperated by a blank line. The .glsl files and .scn file need to be in the ShadersGLSL subfolder. Used textures need to be in the Textures subfolder and should be in .tga format. Used models need to be in the Models subfolder and are in a custom format that should easy to understand: Code:
But for the moment i am confused by how the triangle indices work. More important are the material names as you can assign shaders to them in the .scn file. So for now i name my material after an material available in an object. Setting up a scene with materials is done like this: Code:
First you need to specify the model you want to use Next a background (don't know where these are specified) Next you specify how the object is positioned Now we need to specify the materials As you can see you can set default values for globals in the glsl shader. Also using one shader you can make multiple materials if your shader is flexible enough. The above is an basic scene. But things can get complicated. Finaly you need to setup some lights. On opening the scene you can compile arb fragment and vertex shaders that you can view and copy and post for use with your opengl application. You can optimize shaders for nvidia and or ati video cards. Oh before i forget you can also compile to directx shaders. Ok this should get you started converting shaders to something less readeable... (be sure to keep your original ![]() |
Autor: | noeska [ Sa Jan 19, 2008 16:35 ] |
Betreff des Beitrags: | |
For creating renderman shaders i use shaderman version 7: http://www.dream.com.ua/thetool.html that is the previous version available at: http://www.dream.com.ua/theoldtool.html (and it supposed to be written in delphi!). I realy like this as it allows to create shaders in a visual way and with ashli i can create arb-fragment en vertex shaders. ![]() |
Autor: | noeska [ Mo Jan 21, 2008 21:17 ] |
Betreff des Beitrags: | |
Also conversion between glsl and hlsl should be possible using nvidia's cg available at: http://developer.nvidia.com/object/cg_toolkit.html the following commands can be used (have not tested it yet): cgc -oglsl -profile fp30unlimited some_wicked_shader.frag cgc -oglsl -profile vp30 some_wicked_shader.vert to create assembly like shaders, but hlsl and glsl are also targets, so conversion from glsl to hlsl should also be possible. |
Seite 1 von 1 | Alle Zeiten sind UTC + 1 Stunde |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |