Bump mapping for Animated meshes

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Bump mapping for Animated meshes

Post by The_Glitch »

I'm not sure about Nadros CG wrapper I've never used it. Maybe he doesn't use those methods like the traditional methods. I also believe that he's cg wrapper is old I'm not to sure though.
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Bump mapping for Animated meshes

Post by Vectrotek »

Okay! There is this question that I asked about a certain method I couldn't seem to find.

What do I have to do to get "->getVertexShaderConstantID"?
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Bump mapping for Animated meshes

Post by mongoose7 »

Code: Select all

#ifdef IRRLICHT18
        services->setPixelShaderConstant("ScreenMapSampler", &TexVar, 1); 
#else
        index = services->getPixelShaderConstantID("ScreenMapSampler");
        services->setPixelShaderConstant(index, &TexVar, 1); 
#endif
This is for a pixel shader but it is similar for the vertex shader. The code you are following is for trunk, but I guess you are using 1.8 so you will have to revert the code.
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Bump mapping for Animated meshes

Post by Vectrotek »

Thanks Mongoose7! From your post I gather that getting the actual Constant ID is now done inside of Irrlicht
which is really cool.
But..

Why!

Image

This happens on every machine I've tried it on.

I know that I have CG support.
In fact Nadro's old CG Wrapper runs cool (even if I can't compile it which is another headache)
All my old win 32 programs run fine.

What is wrong with example 10?
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Bump mapping for Animated meshes

Post by mongoose7 »

I don't think Irrlicht supports Cg anymore. Anyway, grep the code for the message and see what is going on.
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Bump mapping for Animated meshes

Post by Vectrotek »

Thanks.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Bump mapping for Animated meshes

Post by CuteAlien »

In Irrlicht 1.8 cg was disabled by default. So you have to re-compile Irrlicht with cg support enabled (in IrrCompileConfig.h) and also you need to install the cg sdk to compile it.
In trunk (aka Irrlicht 1.9 one day) cg support has been removed completely, due to lack of maintainers and because NVidia also stopped developing it. Basically it's a dead tech - don't use it anymore for new projects.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Bump mapping for Animated meshes

Post by Vectrotek »

Thanks Again Alien! Keep up the incredibly good work you guys are doing! Cheers!
Last edited by Vectrotek on Mon Oct 05, 2015 9:29 pm, edited 2 times in total.
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Bump mapping for Animated meshes

Post by The_Glitch »

VectroGeek just use hlsl since your on windows at least that way I can help you.
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Bump mapping for Animated meshes

Post by Vectrotek »

Hey Itchy! You here? Sure! That's how I intend to get to grips with it! But you'll have to visit my GPU Topic!
I'm definitely going to call on you! See you on the other side bud!
What we're going to have to solve is quite beyond just bump-mapping! I can feel it..
If and when we solve this well come back here yes?
Kojack
Posts: 67
Joined: Sun Jan 20, 2008 2:39 am

Re: Bump mapping for Animated meshes

Post by Kojack »

Vectrotek wrote: If I should make use of "private" messaging more so that all these "Ogre" cats don't get all our trade secrets let me know.
Image
Don't mind me, just passing by...
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Bump mapping for Animated meshes

Post by CuteAlien »

@Vectrotek: We still support GLSL (OpenGL) and HLSL (D3D). Just CG is out. I have the feeling you mix up CG and GLSL as you wrote about OpenGL's CG. But CG was a library+compiler from NVidia which was about writing shaders once and then compiling them to both - OpenGL and Direct3D shaders. But that compiler was always proprietary and now with the end of support for it that tech is likely dead.

So pretty certain you meant GLSL - which we will absolutely continue to support!
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Bump mapping for Animated meshes

Post by Vectrotek »

If all "Ogre Cats" are that cute..
Last edited by Vectrotek on Fri Sep 25, 2015 7:16 pm, edited 1 time in total.
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Bump mapping for Animated meshes

Post by Vectrotek »

I think Ill reconsider this one!
Thanks for your input Alien! :)
Last edited by Vectrotek on Mon Oct 05, 2015 9:30 pm, edited 3 times in total.
Kojack
Posts: 67
Joined: Sun Jan 20, 2008 2:39 am

Re: Bump mapping for Animated meshes

Post by Kojack »

As Nvidia's own CG documentation says:
NVIDIA and Microsoft collaborated to develop the Cg language. Microsoft calls its implementation High-Level Shading Language, or HLSL for short. HLSL and Cg are the same language but reflect the different names each company uses to identify the language and its underlying technology. HLSL is a part of Microsoft's DirectX Graphics, a component of the DirectX 9 multimedia framework. Direct3D is the 3D component of Microsoft's DirectX Graphics. Cg is independent of the 3D programming interface and fully integrates with either Direct3D or OpenGL. A properly written Cg application can be written once and then work with either OpenGL or Direct3D.
Vectrotek wrote:There is no "*.frag" or "*.vert" even if seemingly well informed sources hand this to you on a silver platter with or without barbecue sauce!
There can be if you want. Flightgear, X-Plane, Overgrowth, QT and others all use .vert and .frag.
The extension can be anything. CG files are loaded by giving a string to the cgCreateProgram function, that string can come from anywhere. Of course some engines may not let you load shaders from an unexpected extension, but that's a different matter, CG itself doesn't care.
Post Reply