Sign in to follow this  
Shockwave

[updated]how to convert from GLSL to HLSL?

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this