Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: 1 2 [3] 4 5 6
  Print  
Author Topic: A basic 3rd person demo  (Read 27888 times)
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #40 on: October 21, 2006, 08:58:19 AM »

I'm a bit confused why you get an error on the RAR file, I just downloaded it to quote following and it worked :
Code:
Private Shader As TVShader

...

    Set Shader = Scene.CreateShader
    Shader.CreateFromEffectFile "relief_mapping.fx"
    Shader.SetTechnique "normal_mapping"
    Shader.SetEffectParamFloat "tile", 1
    Shader.SetEffectParamFloat "shine", 20

...

    WhateverTVMesh.SetShader Shader

That's it. Not much magic Tongue
Don't forget to create a light, too.
Logged

aviles22
Community Member
*
Posts: 323


« Reply #41 on: October 21, 2006, 09:49:18 AM »

Zak:

The original Demo.rar gives me this error when I open it:
C:\Documents and Settings\nicole\Desktop\Demo.rar: Unexpected end of archive

The downloader says there is  13.6MB but it stops downloading at 42.4KB and the unzipped demo just contains folders. Your remake of Demo.rar is in C and it downloads fine.

The original is in VB.net and I was just curious of how you got the same effect without using a shader.fx?

I am studying shaders very hard but I am a complete newbie! I even bought a book but it just jumped right into programming them which for now really wasnt the approach I wanted to take. I just want to have a good understanding of what they are and how they differ from TVMaterials. I remember someone saying that TVMaterials are actually shaders. True or not?

Another question is:

I downloaded Nvidias shaders from there site and I load them on basic objects with no textures applied in TVModelViewer and some of them seem to work fine but when I apply them to a mesh that has a texture applied the shader doesnt seem to have an affect. Such as MrWiggle.fx and Wood.fx

I'm just a little confused being a newby:
Are there specific shaders that only work with texturerd meshes and untextured meshes or is this because there arent many shader options available in ModelViewer like there would be if I loaded them into TVEngine like your last post?

I havent loaded them in my own code yet>> Just fooling aroud with them in ModelViewer.

Thanx
Logged
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #42 on: October 21, 2006, 10:13:27 AM »

Quote from: "aviles22"
The original Demo.rar gives me this error when I open it:
C:\Documents and Settings\nicole\Desktop\Demo.rar: Unexpected end of archive

The downloader says there is  13.6MB but it stops downloading at 42.4KB and the unzipped demo just contains folders. Your remake of Demo.rar is in C and it downloads fine.

That's strange. Once I'm home I'll mirror it on my server...

Quote from: "aviles22"
The original is in VB.net and I was just curious of how you got the same effect without using a shader.fx?

Ah! Sorry for the misunderstanding. Here are the steps :
1. Make sure you have a light in your scene
2. Make sure your mesh has a material applied with specular, specular power and diffuse slots filled. The ambient and emissive values should be low or null
3. Set the mesh's lighting mode to TV_LIGHTING_BUMPMAPPING_TANGENTSPACE
4. Make sure your mesh has a normal-map in the right texture stage, and a standard "diffuse" texture as well
5. If you want specular, TVLightEngine.SetSpecularLighting True

That should be it...

Quote from: "aviles22"
I remember someone saying that TVMaterials are actually shaders. True or not?

Absolutely not true. In fact most shaders depend on TV materials to work.

A material is just a collection of values to hint the renderer on how the object should react to light. The percentage of diffuse reflection, specular reflection, how much ambient light it recieves, how focused to specular reflection should be, etc.

A shader is the GPU program that uses that information and other information (other semantics and shader params) to render the mesh.
If shaders aren't used, then the standard "fixed-function pipeline" a.k.a. T&L is used to render the mesh the normal, per-vertex-lit, standard way.

You don't have to use a custom TVShader to use shaders. There are many TV built-in shaders like tangent- and object-space normal-mapping, offset bump-mapping (parallax mapping), per-pixel specular, animation blending, progressive LOD on the landscape, etc... Those shaders are used internally by TV3D when you set specific options.

Quote from: "aviles22"
Are there specific shaders that only work with texturerd meshes and untextured meshes or is this because there arent many shader options available in ModelViewer like there would be if I loaded them into TVEngine like your last post?

Some shaders will appear black if you don't give them textures, yes. And some shaders will need you to set up a certain MeshFormat... since this defines what semantics TV fills for the shader.
The shader effect params are also specific to the shader, some of them won't have params at all.
That's why I hate to use "generic" shaders from nVidia and ATi and whatnot... You never know how they're supposed to work Tongue
Logged

aviles22
Community Member
*
Posts: 323


« Reply #43 on: October 21, 2006, 10:25:02 AM »

That last post really helped me on Direction! Thanks again ZAK for your wisdom. Sometimes the best book cant answer the important questions that are needed to Move on to bigger things.
Logged
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #44 on: October 21, 2006, 10:26:36 AM »

No problem, glad I helped. Smiley
Logged

aviles22
Community Member
*
Posts: 323


« Reply #45 on: October 21, 2006, 06:35:44 PM »

OK ZAK:

Here is my Screenie:



I just cant seem to get that glossy looking appearance on my Actor like the Demo you enhanced!

Here is my Code:

Light.SetSpecularLighting(True)

Dim PointLight As New TV_LIGHT
        PointLight.type = CONST_TV_LIGHTTYPE.TV_LIGHT_DIRECTIONAL
        PointLight.direction = New TV_3DVECTOR(0.5F, -0.5F, 0.8F)
        PointLight.diffuse = New TV_COLOR(0.8F, 0.8F, 0.8F, 1)
        PointLight.range = 2500
        PointLight.attenuation = New TV_3DVECTOR(0, 0, 0)
        Dim LightNo As Integer
        LightNo = Light.CreateLight(PointLight, "Sunlight")
        Light.EnableLight(LightNo, True)
        Light.SetLightProperties(LightNo, True, True, False)
        Light.SetGlobalAmbient(0, 0, 0)
        Scene.SetShadowParameters(G.RGBA(0, 0, 0, 0.5F), True)

        Dim MatID As Integer
        MatID = Material.CreateMaterial("Matte")
        Material.SetAmbient(MatID, 0.25F, 0.25F, 0.25F, 1)
        Material.SetDiffuse(MatID, 1, 1, 1, 1)
        Material.SetSpecular(MatID, 0, 0, 0, 1)
        Material.SetEmissive(MatID, 0, 0, 0, 1)
        Material.SetOpacity(MatID, 1)
        Material.SetPower(MatID, 0)

Trooper = Scene.CreateActor
        Trooper.LoadTVA("C:\TVTony\VB.NET\Actors\Trooper.tva", True, False)
        Trooper.SetMaterial(G.GetMat("Matte"))
        Trooper.SetLightingMode(CONST_TV_LIGHTINGMODE.TV_LIGHTING_BUMPMAPPING_TANGENTSPACE)
        Trooper.SetShadowCast(True, True)
        Trooper.SetRotation(-90, 0, 0)
        Trooper.SetPosition(1000, 0, 1000)
        Trooper.SetScale(0.015, 0.015, 0.015)
Logged
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #46 on: October 21, 2006, 09:05:22 PM »

Quote
Material.SetSpecular(MatID, 0, 0, 0, 1)

Not good. Put (1, 1, 1, 1).

Quote
Material.SetPower(MatID, 0)

Not good either. The value must be > 1.

Also I noticed your point light doesn't have a specular color. You should set it to (1, 1, 1, 1).
And make sure your TVA has a normal-map.

Edit : This should be a good read for you... Explains many aspects of materials. http://wiki.truevision3d.com/tv3d/materials_tutorial_by_javin
Logged

Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #47 on: October 22, 2006, 11:55:24 AM »

@aviles22 and anyone who had problems opening my RAR file, upgrade to the latest version of WinRAR to fix the problem. The archives are fine, seems like a bug in the 2.x versions of WinRAR.
Logged

aviles22
Community Member
*
Posts: 323


« Reply #48 on: October 22, 2006, 01:51:52 PM »

No ZAK your version RAR was fine! I was talking about the original RAR file written in VB.

And also by the way I did download your C version and took your code for the materials and things and copied it to my own app and tried to apply them to my own actor as in the previous post and the values you told me to change are exactly what you used.

What do you mean by applying a normal map?
Logged
aviles22
Community Member
*
Posts: 323


« Reply #49 on: October 22, 2006, 01:53:42 PM »

ZAK I have to look at your code again. Maybe you set them somewhere else in your DEMO. Thanx again!
Logged
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #50 on: October 22, 2006, 04:20:00 PM »

In fact, AGT's actor (a TVA file) already had a normal-map applied. If you open it with modelview you'll see it.
So if your model is not a TVA or if it doesn't have a normal-map assigned, you can put it with SetTextureEx in the CONST_TV_LAYER.TV_LAYER_NORMALMAP stage.
Logged

AGT
Customers
Community Member
*****
Posts: 474


WWW
« Reply #51 on: October 22, 2006, 06:45:05 PM »

You can use ATI's Normal map maker to make your normal maps from your textures.
Then you can apply those normal maps in model view also if you don't want to do that in code. Just don't forget to save your model too.
Logged

aviles22
Community Member
*
Posts: 323


« Reply #52 on: October 22, 2006, 10:43:12 PM »

AGT can you check your version of the 3rd Person Demo as the link is still there but its giving me an end of archive error when extracted. I want to look at your normal map. Thank you!
Logged
AGT
Customers
Community Member
*****
Posts: 474


WWW
« Reply #53 on: October 22, 2006, 10:58:29 PM »

I just did that and it seems to be fine. Are you using WinRar? Because it's a .rar file.
Logged

Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #54 on: October 22, 2006, 10:59:56 PM »

By the way, my version has the same normal map. Else there'd be no normal-mapping... Tongue
Logged

AGT
Customers
Community Member
*****
Posts: 474


WWW
« Reply #55 on: October 22, 2006, 11:01:06 PM »

Quote
By the way, my version has the same normal map. Else there'd be no normal-mapping...


That's correct  Smiley
Logged

AGT
Customers
Community Member
*****
Posts: 474


WWW
« Reply #56 on: October 22, 2006, 11:20:42 PM »

Zak, do you know if it's possible to apply parallax or relief mapping with non-seamless textures?
Logged

aviles22
Community Member
*
Posts: 323


« Reply #57 on: October 23, 2006, 01:54:53 PM »

OK Guys please be patient with me?

I specifically want to focus on the this group of the HMale.TVM because its the effect I'm trying to get on my Actor.

This is the UVMap:


This is your NormalMap: Yes or No


Using the Normal Map Plugin I loaded the first image and converted it to a Normal Map and this is what I came up with: Different then your NormalMap-->Why?


Here are the PluginSettings:


OK then I ran the C demo and renamed the Body_Map.DDS normal map image so that TV wouldnt load it and the Material was still the same on the Actor.

What does Body_Map.DDS actually do for the Actor?
Please be patient with my inexperience to this Topic as I am a newbee to this stuff?
Logged
AGT
Customers
Community Member
*****
Posts: 474


WWW
« Reply #58 on: October 23, 2006, 02:18:03 PM »

Hey aviles22.
Quote
Using the Normal Map Plugin I loaded the first image and converted it to a Normal Map and this is what I came up with: Different then your NormalMap-->Why?

The Greystyle texture is a bumpmap, all bumpmaps are greystyle references of the textures in most cases. The purple texture you created is a NormalMap. I didn't make any normal maps for the actor but everything else has a normal map. Like the shiny armor for instance.

Quote
What does Body_Map.DDS actually do for the Actor?

The normal map you created does almost the same thing as the bumpmap in this case because it illustrates only the "bumps" that the texture should have.
In a few words you won't see any major deferences on hmale.
Usually I use normal maping to achieve better quality in specular lighting.

Edit:
Quote
Please be patient with my inexperience to this Topic as I am a newbee to this stuff?

Hehe.. Not to worry. Everyone's got to learn one way or another Smiley
Feel free to ask Cheesy
Logged

AGT
Customers
Community Member
*****
Posts: 474


WWW
« Reply #59 on: October 23, 2006, 02:25:14 PM »

And another thing.
aviles22, If you still want the original demo I could mail it to you If you want.
Logged

Pages: 1 2 [3] 4 5 6
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks