HLSL to GLSL conversion: problems

Started by
4 comments, last by Charly7 16 years, 2 months ago
Hi all, I'm new in shader's world and I'm trying to learn GLSL. I did some tutorial and I can say that I've understand enough. But now I have a problem. I want to do a shader that create a glow sun effect but I don't know how I can do this. I have my sphere in OpenGL and I need a shader that make it like a sun (with the glow all around it). I've found a shader (fragment and vertex) written in HLSL (from RenderMonkey). I tryed to translate it by myself and with the HLSL2GLSL (that convert it automatically) but in both cases it doesn't work and I can't see nothing. So, is there somemoby that can help me??? I'm despairing because I need this for my degree thesis. Please help me!!! I hope that my explanation is been clear enough. If you want to receive more information about what I've to do contact me and I'll give you some picture or the HLSL shader. I'll wait for your indispensable help. Charly
Advertisement
Without knowing what exact shader you want to use, it's difficult to help you much...
I just recall most D3D shaders involving halos are really Effects. FX is a "super-HLSL" which cannot be translated in GLSL yet. If you're using an effect, forget about a magic tool.

In general however, translating shaders is never so difficult, you shouldn't need the translator in the first place.

Previously "Krohm"

Ok I try to be more precise. I want to create a scattering shader in GLSL(pixel and fragment) in order to create the atmosphere for my earth sphere and glow for my sun sphere. I hope this time I've been clearer and I hope that you can help me.
Thx.

Charly
IIRC, More OpenGL Programming has an example application on a Glow Shader. There should be some information on it somewhere here, because i think Dave wrote it.

I have the book somewhere so I'll see if I can find it. Though I don't feel comfortable just giving you the shader if its for Uni work, you wouldn't learn anything and wouldn't be able to explain what it did.
Are you talking about "Golder Shine.rfx" for RenderMOnkey
It displays a coin with a glow effect.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Neutrinohunter I need this shader for my degre thesis but my thesis is not about shader. I need it to make better my work. I have a little time so I can't spent much time trying to obtain the shader I want.
So I ask you to give me the shader if you find it. Shader are a new and very interesting topic for me so I won't do only copy and paste if you give me it because I want to learn more and became more confident about it. But now I've no time but I'd like to make better my work.

Anyway like I wrote yesterday I want to write shader to obtain atmospheric scattering for my sun and my earth.
So once again, can somebody help me???
Thx.

Charly

This topic is closed to new replies.

Advertisement