Normal maps in Ogre?

Advanced game related topics
DarkDragon
Addict
Addict
Posts: 2228
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

Blobby wrote:Can I ask which tool you use to generate your material files and shaders?
Notepad.

For validating GLSL shaders I use glslValidate from 3DLabs (they aren't offering it anymore).

@djes: That was the first example I've looked when I was going deeper into OGRE. :wink: So there's no need to be sad.

Maybe you could write those links into your topic:
OGRE Manual - Table of contents
Automatically defined shader variables ...
bye,
Daniel
Blobby
User
User
Posts: 17
Joined: Tue Mar 03, 2009 2:30 pm

Post by Blobby »

djes wrote:
Blobby wrote:There's no examples on the forum at all.
:cry: http://www.purebasic.fr/english/viewtop ... ht=shaders
oops :oops:


and thanks!

I should've known you would've done something as you made that cool water demo too :)
Blobby
User
User
Posts: 17
Joined: Tue Mar 03, 2009 2:30 pm

Post by Blobby »

DarkDragon wrote:
Blobby wrote:Can I ask which tool you use to generate your material files and shaders?
Notepad.

For validating GLSL shaders I use glslValidate from 3DLabs (they aren't offering it anymore).
I don't see the option to generate material files in Notepad! :(

Just kidding. ;)
DarkDragon
Addict
Addict
Posts: 2228
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

Update

Image

Now it works with an variable number of lights through multipass rendering.
And I've done some changes.

Same link, new luck (Clear your cache):
Download
bye,
Daniel
Falko
Enthusiast
Enthusiast
Posts: 269
Joined: Sat Oct 04, 2003 12:57 pm
Location: Germany
Contact:

Post by Falko »

wow DD, this is a very good sample.
www.falko-pure.de
Win8 Pro 64-Bit & Mediacenter, PB_5.1B7, GFA-WinDOS, Powerbasic9.05-Windows, NSBasic/CE, NSBasic/Desktop, NSBasic4APP, EmergenceBasic
Blobby
User
User
Posts: 17
Joined: Tue Mar 03, 2009 2:30 pm

Post by Blobby »

Another nice example, Daniel!.

What I'm a little puzzed over is the form of the light on all your examples. It seems to have a radial quality to it in that as the object rotates you see a line of light running up the center.

I remember once seeing a material with a similar quality in Maya, I think it's name was Blinn. I imagine it'll be good for metalic materials.
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Normal maps in Ogre?

Post by IdeasVacuum »

Hello Daniel

Normalmapping.pb crashes PB4.40(x86) during compilation. Any idea why?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Normal maps in Ogre?

Post by IdeasVacuum »

...Ah, it's because Engine3D.dll is in the Project Folder, so not a problem!
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Lexicon
User
User
Posts: 98
Joined: Mon Jul 22, 2013 6:16 am
Contact:

Re: Normal maps in Ogre?

Post by Lexicon »

Nice work!

But...

Code: Select all

    ;LoadMesh(0, "sphere.mesh")
    
    CreateCube(0, 8)
    GetScriptMaterial(0, "Normalmap")
    
    Parse3DScripts()
    
    ; Create a cube
    CreateEntity(0, MeshID(0), MaterialID(0)) ; #PB_Material_None)
... and nothing. :( Why?
PureBasic 5.11 | WinXP | 2GB RAM | GForce GT240
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Normal maps in Ogre?

Post by Samuel »

I believe you need to give your mesh tangents. After you create your mesh try BuildMeshTangents(#Mesh).

I also think Parse3DScripts() needs to go after your Add3DArchives, but before you load the material script.

Code: Select all

    Add3DArchive(PathToScripts$, #PB_3DArchive_FileSystem)
    Add3DArchive(PathToTextures$, #PB_3DArchive_FileSystem)
    Parse3DScripts()

    CreateCube(0, 8)
    BuildMeshTangents(0)

    GetScriptMaterial(0, "Normalmap")

    CreateEntity(0, MeshID(0), MaterialID(0))
User avatar
Lexicon
User
User
Posts: 98
Joined: Mon Jul 22, 2013 6:16 am
Contact:

Re: Normal maps in Ogre?

Post by Lexicon »

Samuel wrote:I believe you need to give your mesh tangents. After you create your mesh try BuildMeshTangents(#Mesh).

I also think Parse3DScripts() needs to go after your Add3DArchives, but before you load the material script.

Code: Select all

    Add3DArchive(PathToScripts$, #PB_3DArchive_FileSystem)
    Add3DArchive(PathToTextures$, #PB_3DArchive_FileSystem)
    Parse3DScripts()

    CreateCube(0, 8)
    BuildMeshTangents(0)

    GetScriptMaterial(0, "Normalmap")

    CreateEntity(0, MeshID(0), MaterialID(0))
Thanks S! I have PB 5.11 and no have this command. :wink:
But I saw this text on the OGRE wiki: http://www.ogre3d.org/tikiwiki/tiki-ind ... umpMapping
Important Hint: To use bumpmapping, we'll need tangent vectors for our meshes.

OGRE can do this for you ahead of time if you use the '-t' parameter to the command line tools OgreXmlConverter or OgreMeshUpgrade.
I'll try and report. 8)
PureBasic 5.11 | WinXP | 2GB RAM | GForce GT240
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Normal maps in Ogre?

Post by Samuel »

In the past I've used OgreXmlConverter to add tangents to my meshes. It's pretty easy, but it can be time consuming if you have a lot of meshes to alter.
User avatar
Lexicon
User
User
Posts: 98
Joined: Mon Jul 22, 2013 6:16 am
Contact:

Re: Normal maps in Ogre?

Post by Lexicon »

Samuel wrote:In the past I've used OgreXmlConverter to add tangents to my meshes. It's pretty easy, but it can be time consuming if you have a lot of meshes to alter.
I believe that will be around a thousand.
PureBasic 5.11 | WinXP | 2GB RAM | GForce GT240
Post Reply