Sign in to follow this  
LukasBanana

XShaderCompiler (HLSL to GLSL translator)

Recommended Posts

Nice I will check it out!

 

I havent tried it yet, but could you describe how you translate things like SamplerStates and texture sampling?

Off topic:
I'm doing a similar thing, and I call it again XShader(https://github.com/ongamex/XShader) it is nowhere near completion - but yeah I guess the race for the name is ON :D

Edited by imoogiBG

Share this post


Link to post
Share on other sites

Nice I will check it out!

 

I havent tried it yet, but could you describe how you translate things like SamplerStates and texture sampling?

Off topic:
I'm doing a similar thing, and I call it again XShader(https://github.com/ongamex/XShader) it is nowhere near completion - but yeah I guess the race for the name is ON :D

 

I first had the name XShader in mind, but checked it on GitHub, to see if there are other projects with this name.

So I changed it to XShaderCompiler ^^

 

Unfortunately, GLSL still lacks the logic separation of sampler states and texture buffers, although there are Sampler Objects in OpenGL.

So I remove all appearances of SamplerState in the AST and only translate the Texture2D etc. to sampler2D respectively.

 

e.g. "tex0.Sample(samplerState0, texCoord)" becomes "texture(tex0, texCoord)".

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