Normal Map

May 11, 2010 at 4:38 PM

Hey all!

Having some problem with normal mapping, I just can't get it to work :)

iv'e tried to do and exact copy of the image shown on the startpage of OX, but i cant seem te get the same effect. What am I doing wrong?
http://digitalstudent.se/upload/upload/normal.jpg

 

ball to the right is normalMappedAnonymousBall, and the left one is regular AnonymousBall.

Also, iam using the newest version from SVN.

 

//Torshall

Coordinator
May 13, 2010 at 11:06 AM

That might be confusing because that screen is from a very old version of the engine.

There's a couple of options. First, you make a new type of scene component that enables normal mapping by using a NormalMappedSurface by default. This will allow only certain scene components to be normal mapped. Alternatively, if you want normal mapping on all scene components, you have to subclass SurfaceFactory to return a new NormalMappedSurface when handed a typeof(StandardSurface), as well as override DefaultEngine's CreateSurfaceFactoryHook to return your specialized surface factory.

cheers!

May 13, 2010 at 1:23 PM
Edited May 13, 2010 at 1:24 PM

Thanks for ur reply!

I've created a new StandardModel script class for my floor object in this case. But how do i acctually set NormalMappedSurface to be used?

My guess is that i should do something like this;

 


            NormalMappedSurface normal = new NormalMappedSurface(engine, Component);
            normal.NormalMapEnabled = true;

 

            Component.SetSurface(normal);

 

But of course, sens Component.SetSurface dosent exist, it should be passed on somewhere else. But where and/or how? :)
I really appreciate your help!


//Torshall

 

 

Coordinator
May 15, 2010 at 5:01 AM

What I meant is that you should create a new scene component type by subclassing StandardModel and StandardModelToken as explained in the Advanced concepts portion of 'Engine Overview.doc'.

Still, I doubt that's enough documentation to make it easy to do. Do your best and ask questions if you get stuck on creating a user-defined component.

I'll be here :)

cheers!

May 15, 2010 at 12:19 PM
Okey, thx mate! I'll give it a go :)