[updated]how to convert from GLSL to HLSL?

Started by
3 comments, last by Shockwave 18 years, 1 month ago
Maybe somebody knows a program for converting from GLSL to HLSL code or can advise some article/tutorial/thread on a forum about how to convert manually GLSL instructions into HLSL one? For example I'm confused with varying variables. Thanks in advance. [Edited by - Shockwave on March 13, 2006 8:43:54 AM]
Advertisement
I don't have any resources to direct you at, but from the bits-n-pieces I've heard you'll be better off thinking at the algorithmic rather than syntactic level.

That is, pretty much all shaders break down to simple mathematical equations and texture IO - thats your common language [wink]

Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

I have to agree with Jack,
You should understand the theory behind a technique or effect. Armed with the theory you can open up a GLSL or HLSL code base and follow what goes on inside of them. Although, I don't know of any programs that will help you convert or will automagically convert them for you.

What I suggest is take a look at the theory and then open the GLSL shader again and see if you can follow on a theory based level.

I don't know GLSL that well but I have implemented some shaders in HLSL from GLSL and from what I can see, the varying variables means that the variables changes each frame or they have the ability to vary.

I hope this helps.
Take care.
http://www.gamedev.net/community/forums/topic.asp?topic_id=376033

Insufficent Information: we need more infromationhttp://staff.samods.org/aiursrage2k/
Ok thanks for your answers. :)
The reason I've asked about converter is because I have found a good tutorial about per-pixel lightning for spot, point and directional light sources but implementation is in GLSL. Maybe you can advice me some good tutorial for implementing per-pixel light for directional, point and spot light sources in HLSL?
I have downloaded a tutorial from www.ultimategameprogramming.com that covers
a per-pixel directional light and in the source code I've found that the author gives the position for his light!
As I know, directional light doesn't have a position only direction and range.

This topic is closed to new replies.

Advertisement