Hi. I'm IrrWHAT
this is my first time on the forum (so be nice ).
I am not a complete noob to programming C++ but I am to Irrlicht. I like it so far and wish to continue with it. For a long time I've wanted to have a go at shaders, long before I got irrlicht, but it all went over my head. glsl, hlsl, fragment shader and pixel shader, where all unknown terms to me and I couldn't find a good tutorial to fix my confusion. I know what they mean now, but I'm not sure what I should be learning to start using shaders with Irrlicht (I haven't learnt a shader language yet).
I want my programs to run on gl and dx APIs but that would involve learning GLSL and HLSL, which, when combined are too hefty a read for me to find the time to learn.
I found the alternative, IrrCG, an abstraction from the two languages. Sadly I can't get any of the examples to compile (probly bad library linking on my part) and I am having trouble finding good documentation on how to use it. Then I read somewhere that the current version doesn't support PS3, which especially disappointed me as I wanted to look into steep parallax, among other things (which tend to require PS3).
I had a brief look at the description of ATI's ASHLI, but it is a big download on my slow connection, when I am not really sure if it is what I'm after.
A GLSL<->HLSL converter that doesn't require an entire abstracted language would be perfect (but that's asking for too much ).
I am willing to learn one shader language but not two. And I really would much rather have PS3 support than not.
Any suggestions?
Shaders - Where to start?
-
- Posts: 331
- Joined: Sat Sep 02, 2006 4:11 am
- Location: Michigan
- Contact:
Hi, for first You should read Cg tutorial:
http://http.developer.nvidia.com/CgTuto ... ter01.html
I think, than Cg shading language is the best language if You use both API: DirectX and OpenGL. Next You can use easy tu use IrrCg (I don't know how problems with linking You are, I release source code, so linking isn't problem now, IrrCg usage similar to standard irrlicht shader usage method and You can see how is done in examples). Of course IrrCg has got support for Shader Model 3.0 because this is only wrapper and has got all profiles etc. from native cg libraries.
http://http.developer.nvidia.com/CgTuto ... ter01.html
I think, than Cg shading language is the best language if You use both API: DirectX and OpenGL. Next You can use easy tu use IrrCg (I don't know how problems with linking You are, I release source code, so linking isn't problem now, IrrCg usage similar to standard irrlicht shader usage method and You can see how is done in examples). Of course IrrCg has got support for Shader Model 3.0 because this is only wrapper and has got all profiles etc. from native cg libraries.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Lol (Waves from across the tasman)Hi. I'm IrrWHAT
No idea where you read that, but its wrong.Then I read somewhere that the current version doesn't support PS3,
The shader example in the SDK is a start.I know what they mean now, but I'm not sure what I should be learning to start using shaders with Irrlicht (I haven't learnt a shader language yet).
The best GLSL<->HLSL converter is yourself, first of all, they are very very similar, (Just change from float3 to vec3 and some lerp() to mix(), etc), and secondly most converters won't convert the mathematical concepts correctly, for example the ATI converters didn't swap the order of multiplication of my matrices because it didn't know what I was doing (GL has a different matrix coordinate system from Direct3D), so I had to swap them myself.A GLSL<->HLSL converter that doesn't require an entire abstracted language would be perfect (but that's asking for too much Wink).
I recommend looking at and trying to implement examples in Irrlicht, the NVidia shader library has alot of nice stuff (They come in HLSL and CG versions), and theres alot of stuff to check out on the forums here. Then I recommend studying some mathematical concepts involving shader algorithm, because it's necessary to know that stuff more than anything, the language is the easy part (And thats why I say whether its hlsl or glsl its irrelevant, it just comes down to the mathematical formula you're trying to convey).
Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Thx alot.
I read that irrCG didn't support PS3 in a forum somewhere (don't remember which). It was probably talking about a really old version of IrrCG, or it was just wrong. Glad to know it does support it!
Thx for the quick response too. Getting a response from Nadro, creator of IrrCG, is cool. Having the creator speak to you gives much more reliable information than an outdated forum topic/person who doesn't know what they're talking about .
IrrCG looks like what I'm after. I'm still having a problem though . The line
is confusing me. Neither me nor my compiler know where cg.h is.
I read that irrCG didn't support PS3 in a forum somewhere (don't remember which). It was probably talking about a really old version of IrrCG, or it was just wrong. Glad to know it does support it!
Thx for the quick response too. Getting a response from Nadro, creator of IrrCG, is cool. Having the creator speak to you gives much more reliable information than an outdated forum topic/person who doesn't know what they're talking about .
IrrCG looks like what I'm after. I'm still having a problem though . The line
Code: Select all
#include <Cg/cg.h>
LOL, hi blindsideLol (Waves from across the tasman)Hi. I'm IrrWHAT