Crystal Space
Welcome, Guest. Please login or register.
August 22, 2014, 05:03:58 pm

Login with username, password and session length
Search:     Advanced search
9005 Posts in 2043 Topics by 8333 Members
Latest Member: Deminagomez76
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  SOLVED -Bumpmaps, Normalmaps etc...
« previous next »
Pages: [1] Print
Author Topic: SOLVED -Bumpmaps, Normalmaps etc...  (Read 4238 times)
Phorem
Newbie
*
Posts: 22


View Profile
« on: July 16, 2005, 07:12:53 pm »

First off, I want to say hello. I'm not new to 3D design, just new to 3D graphical design. I have been a CAD designer for about 10 years now, working on anything from water treatment plants to rocket engines (liquid propellant). My point isn't to give you my life story, my point is in the subject - textures.

I have been trying in vain to get my Blender textures to have normal or bump mapping done in CS. I have scoured the net for about 2 weeks now trying everything and anything i could find. I did all the Blender to CS tutorials i could find and none of them (that i saw) related to making a simple cube (mesh) have bumpmapping or normalmapping done in CS. I'm at a lost. I even started just hand editing the world files by hand in Kate (Linux notepad). But i still can't even get a simple cube, with a 256x256 texture appear to have any texture mapping at all.

All the tutorials deal with UV mapping and that works fine for me. It's when i want to give my simple maps at least the look of a game from the year 2000, that i have constant problems. Any information on how i might achieve this would sincerely appreciated. A link to a how-to or a simple push in the right direction is all i need.


Here is what i am using :

Gentoo Linux, kernel 2.6.11-gentoo (32 BIT)
Amd64 3200 (1meg L2), 1gig of ram (running in 32bit)
Nvidia FX5900XT

Blender - 2.36
CS - 0.98
blend2cs - cvs - 0.2.4
Gimp - 2.2 with DDS import/export and Normal Mapping plugins
Varicad - 2005 - To export my CAD files

Again, thanks in advanced.
« Last Edit: July 20, 2005, 02:48:55 am by Phorem » Logged
dingobloo
Idle Extrordinare.
Global Moderator
Full Member
*****
Posts: 125


View Profile WWW
« Reply #1 on: July 16, 2005, 09:43:39 pm »

There are really two issues to address here.

One:

Blender materials are not currently exported with Blend2CS or The other python based blender script. (For good reason; some effects are available in offline rendering that just arent available in realtime graphics)

Thus, at this point editing a world file by hand is a necessity.

Two:

Warning: This will only work in the CVS version of crystalspace as i've used an rloop default shader and also have included an abstracted renderloop file.


Bumpmapping/Normalmapping is actually a rather simple process as there are already examples of it inside CS (r3dtest for example).

It involves changing a few seperate parts:

- The Renderloop
- The Normalmap
- The Shader

The Renderloop:

Thankfully such a common renderloop has already been created and abstracted for us, so all we need to do is paste this line into our worldfile at the beginning:
   
   <addon>
     <plugin>crystalspace.renderloop.loop.loader</plugin>
        <paramsfile>/shader/std_rloop_diffuse.xml</paramsfile>
    </addon>

The name of the renderloop is: std_rloop_diffuse
thus, this is the name we must include in the settings block.
   
    <settings>
        <renderloop>std_rloop_diffuse</renderloop>
    </settings>

If this block is already created simply insert the renderloop line.

The Normalmap texture:

This is just an ordinary material that will get applies as a normalmap. (But it retains a normalmap textureclass for various optimisations although it is not necassary).

        <texture name="CRETE2_FLR01_NORM">
            <file>/lib/stdtex/blobbyDOT3.png</file>
       <class>normalmap</class>
        </texture>

The Shader:

Since the inclusion of the default shader system it is now not necassary at least for this example to include the shader simple apply a normalmap to the texture thusly:

      <material name="Torus">
        <texture>C2A1_W1</texture>
        <shadervar name="tex normal" type="texture">CRETE2_FLR01_NORM</shadervar>
      </material>
    </materials>

And there are you have a bumpmapped material, apply if to your objects and if all is well then it should work.


Logged
Phorem
Newbie
*
Posts: 22


View Profile
« Reply #2 on: July 18, 2005, 07:19:41 am »

Hi, thank you very much for your help. I tried doing a couple things with the CVS version of crystalspace and i still can't get what you posted above to work - i know, it's me. But i did get something to work. Here is my world file with some pictures. I want crystalspace to look like the Blender pics.

Blender Pic Normal Mapped:


CrystalSpace Normal map Pic - i think, with world file:



Here is a link to the World file:
http://67.70.95.110/~switch/world

Here are the textures i wanted to use for normal mapping but i still can't get it to work.






The DDS file i used for my World file :


It's obvious i have no clue what i am doing but i think i am making progress.
Thanks for your help.
« Last Edit: July 18, 2005, 08:28:43 pm by Phorem » Logged
dingobloo
Idle Extrordinare.
Global Moderator
Full Member
*****
Posts: 125


View Profile WWW
« Reply #3 on: July 18, 2005, 08:29:53 am »

my first question is that, in the world file, you only load one dds, yet attempt to use the same texture for both normal and textre... how would CS know which is which ?
Logged
Phorem
Newbie
*
Posts: 22


View Profile
« Reply #4 on: July 18, 2005, 01:54:23 pm »

Oh i know. It's all over the place. I tried doing the simple normal map stuff you posted above, but i still couldn't get it to work. So i opened up the parallaxtest and started to edit it for my textures.

As for the dds file, for some reason i thought i read in the the crystalspace manual that dds files were the format that i should use for textures. As for having the texture twice, the first normal texture should have been deleted. I have other examples where i followed it perfectly but still no bumpmap. What the hell is parallax and what exactly have i accomplished? I know it isn't a normal map - i think. 
« Last Edit: July 18, 2005, 02:52:53 pm by Phorem » Logged
Phorem
Newbie
*
Posts: 22


View Profile
« Reply #5 on: July 18, 2005, 09:25:13 pm »

Ok, i am now at a lost. I have tried everything. All i wanted to do is start with a simple cube mesh and bump map it using the two textures i pasted above. But nothing seems to work. All i end up getting is a cube with no bump mapping at all. I also get this error :

" WARNING: could not load plugin 'crystalspace.graphics3d.shader.glcg' "

I thought it would be easy to create a cube and have bump mapping applied to it. Have i done something wrong or is that error above to blame?
Logged
Administrator
Jr. Member
*****
Posts: 51


View Profile Email
« Reply #6 on: July 19, 2005, 06:29:23 am »

Ok, first of all, the shader you are using does not only do normalmappng, it does parallax effect simulation and normalmapping..

Secondly, DDS does support storage of "normal" texture and normalmap in same file, however CS does not support that. You need one texture file with your diffuse texture and one with the normalmap

-M
Logged
Phorem
Newbie
*
Posts: 22


View Profile
« Reply #7 on: July 19, 2005, 07:07:45 am »

After messing around for while, i figured out what parallax does and i fixed the other world file to include only the right textures. However, the Bump/Normal mapping one is still not working.

CS-Normal Map :


It doesn't look like it's doing anything. But this time i know it's grabbing both the normal-png and the texture-png.

Here is the world file for the map above.
http://67.70.95.110/~switch/world-CS
Logged
Phorem
Newbie
*
Posts: 22


View Profile
« Reply #8 on: July 19, 2005, 06:04:39 pm »

Ok, now i know there is something wrong. If i do "walktest -verbose stenciltest" on my Linux computer with the CVS version of Crystalspace i don't get any bumpmapping on the walls. It just looks like a normal texture. If i go to work and use the Windows machine (seriously, windows sucks) using the 0.98-r4 version of crystalspace, all the "tests" worked fine - stenciltest, r3dtest etc.

It appears i have something wrong with my Linux version. Should i go back to the Stable builld? I keep getting the error

" WARNING: could not load plugin 'crystalspace.graphics3d.shader.glcg' "

I don't know what's wrong but something didn't get built when i compiled the CVS version.

Any suggestions?

Edit by thebolt: Keep the language civil
« Last Edit: July 19, 2005, 06:16:50 pm by thebolt » Logged
Administrator
Jr. Member
*****
Posts: 51


View Profile Email
« Reply #9 on: July 19, 2005, 06:20:16 pm »

About the working on one computer and not the other.. what graphics hardware and drivers do you use? The parallax-shader and a few others requires quite some gfx-card (and driver support Smiley

Secondly about your last level.. the material have no shader, so it will use the default shader which is just diffuse software calculated lighting (calculated when you run with -relight). I assume you have at least one light. There is a second problem with that world.. in the material you reference a texture named "bricks.png", but you never load it

-M
Logged
Phorem
Newbie
*
Posts: 22


View Profile
« Reply #10 on: July 19, 2005, 07:08:56 pm »

First off, "Edit by thebolt: Keep the language civil", sorry, i just have a serious distaste for windows.

"what graphics hardware and drivers do you use"

I posted it in my first post but...
1) AMD64 3200 (1meg L2), 1 gig of 3200 ram, FX5900XT and the latest nvidia drivers (running in 32bit Gentoo 2005.1)
2) AMD64 3000 (512 L2), 512 megs of ram, ATI 9600 Pro 128meg (running 64bit - Suse 9.3)
3) AMD Athlon 2000XP, 512 megs of ram, FX5200 128 meg (Mandravia 2005 LE)

All my machines run Linux - Period! smiley


As for the map, what shader should i use??

And for the materials, so adding

<texture name="bricks1">
        <file>bricks.png</file>
</texture>

in additon to the texture already there would help?

Also, would it be better to use CS in 64bit using the ATI card or the 32bit machine with the FX5900XT?

Side note : with the parallax shader and the map above, i get 16FPS at 1600x1200 fullscreen - i guess it does take some power smiley
« Last Edit: July 19, 2005, 07:20:20 pm by Phorem » Logged
Phorem
Newbie
*
Posts: 22


View Profile
« Reply #11 on: July 20, 2005, 02:48:33 am »

Well, i found out what my problem was. I tested the cvs version on my 64bit computer and it worked perfectly; bump mapping and all. That was with the ATI 9600 card. So basically, i copied the the values from the "r3dopengl.cfg" file on my 64bit machine and matched them on my nvidia computer:

; Alternate values to try.
; The picker first looks for the value closest to the setting requested by
; the user. Then, the respective lists are iterated rightwards. The value that
; is changed is determined by the current reduction order.
Video.OpenGL.FormatPicker.ColorBits = 32,24,16,15,12,0
Video.OpenGL.FormatPicker.DepthBits = 24
Video.OpenGL.FormatPicker.AlphaBits = 8
Video.OpenGL.FormatPicker.StencilBits = 8
Video.OpenGL.FormatPicker.AccumColorBits = 24
Video.OpenGL.FormatPicker.AccumAlphaBits = 8
Video.OpenGL.FormatPicker.MultiSamples = 0

Now it works well on all my computers. I'm surprised that i had to hand tweak the opengl file to get the shadowing to work properly.

I also want to say that the 64bit build is pretty solid and i love how rich the ati card makes the colours - not a flame war nor do i work for ati. But nvidia is still faster in Linux. smiley
Sorry if i wasted anybodies time.
Thanks again.

Now if i could only figure out how to make the sound work..........
Logged
deckerego
Full Member
***
Posts: 149


View Profile WWW
« Reply #12 on: July 20, 2005, 01:39:21 pm »

That is really weird... as a Nvidia/Linux guy, I'm glad you posted that.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 9.201 seconds with 15 queries.