HLSLShader class?

Started by AGP, September 17, 2011, 02:56:04 AM

Previous topic - Next topic

AGP

I'm having trouble making that water shader work. But is an HLSLShader class totally out of the question? I've found them MUCH easier to find, even if you don't count NVidia's excelent selection.

EgonOlsen

Hlsl is the DirectX variant of glsl. It's not supported by OpenGL and only available on Windows. Apart from that, it's basically the same thing. Porting between the two shoudn't be that hard.

AGP

Hey, the good news is that I found a HLSL-GLSL translator in SourceForge, written by AMD itself, God bless it. The bad news is that I can't seem to identify what to pass it as the shader's main function (a requirement for the translation). Then I sent you an e-mail asking for help. :- )

EgonOlsen

I'll try to look at that this evening. However, i strongly suggest to get a grasp on how GLSL shaders are written. Otherwise, you won't succeed using them even when you are just doing a copy-and-paste job from other shaders. That's one of the big drawbacks of the new and shiny shader world: The learning curve is steeper and you suddenly have to deal with a lot stuff that was hidden by APIs before.

AGP

#4
I think water (liquids in general) is pretty much all I'll ever feel like using shaders for. I'm programming for pretty much all the platforms I've ever seen these days, learning too much as it is, I'm not sure it's worth adding shaders to the list in my particular case. I'll appreciate your help.

You know what? I wrote that just before I went to sleep. Now that I've had two minutes to think about it, I think a better, more accurate, answer would be to say that the more I see shaders work for me (I don't mean to say I've not seen them in games), the more curious I will get about them. It follows that the more I will learn of them. But I can't seem to test a ready-made Nvidia ocean shader, which is not terribly motivating.

EgonOlsen

I had a look at that stuff...no idea what this converter is useful for, but for sure not for converting this shader. At first, it had three errors...for example, it couldn't handle blah = -0.2; (it failed while parsing the -). I "fixed" these (for example by removing the -), but then it spit out a dozen additional errors about uniforms not being allowed in function calls and whatnot. Given that this converter dates back to 2006, i think that it's just not feasible for current shader code.

AGP

Actually, I think it started being developed in '06, but this version is of around November 2009.

AGP