Normalmapper

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

Normalmapper // The Garage

1  |  

Post by clintonman // Oct 24, 2007, 11:14am

clintonman
Total Posts: 304
pic
I created a script object that makes normal maps from low and high resolution meshes. It's easier than the process described in the trueSpace7 manual for creating a normal map from your own low poly mesh. The process isn't even mentioned in the tS7.5 manual at all.

http://www.clintons3d.com/truespace/normalmap/normalmap.htm

Clinton

Edit: Yikes! You'll have to excuse the colors. They looked better on my notebook PC.

Post by prodigy // Oct 24, 2007, 11:42am

prodigy
Total Posts: 3029
pic
Clinton..

In some way this looks like Zbuffer?? or you are very close to make it ;)

Post by parva // Oct 24, 2007, 11:47pm

parva
Total Posts: 822
pic
Cool think...

I tested it just with ts7.6beta and there I got one crash and no normal map result :(


For the color -> grey part, this code should work:


float3 InColor = Color;

float mult_red = InColor.r * 0.3;

float mult_green = InColor.g * 0.59;

float mult_blue = InColor.b * 0.11;

float add1 = mult_red + mult_green;

float add2 = add1 + mult_blue;

float DivideByOne = add2 / 1.0;

float3 OutGrey = float3(DivideByOne, DivideByOne, DivideByOne);


At least it works for me. I have it as hlsl and as node brick if you are interested.

Post by clintonman // Oct 25, 2007, 4:57am

clintonman
Total Posts: 304
pic
Cool think...
I tested it just with ts7.6beta and there I got one crash and no normal map result :(

For the color -> grey part, this code should work:

float3 InColor = Color;
float mult_red = InColor.r * 0.3;
float mult_green = InColor.g * 0.59;
float mult_blue = InColor.b * 0.11;
float add1 = mult_red + mult_green;
float add2 = add1 + mult_blue;
float DivideByOne = add2 / 1.0;
float3 OutGrey = float3(DivideByOne, DivideByOne, DivideByOne);

At least it works for me. I have it as hlsl and as node brick if you are interested.

I was hoping to not have to change the pixels one by one. If you look inside the object that had the normalmap applied to it it shows the normalmap and a grayscale height image. I copy from that so it must be some setup in the bitmap definition that I'm missing.

At which point did it crash? When you loaded it, after pushing the first button...?

Post by parva // Oct 25, 2007, 5:45am

parva
Total Posts: 822
pic
the crash occured after generating the normal.

But it happens just once, not repeatable so far. Weird is just that the high res mesh lost all details, means the extruded faces I done for the test are gone.

I tried a segmented plane with some extruded faces as test.

Post by clintonman // Oct 25, 2007, 9:20am

clintonman
Total Posts: 304
pic
You want to make a copy of the high res first because the script uses the built in normalmapper on the high res mesh, so it works the same way. The high res disappears replaced by the internal normal map version.

Post by clintonman // Sep 9, 2008, 8:13am

clintonman
Total Posts: 304
pic
Updated the normalmapper script to version 1.3.


1. Exports correct gray bump map.

2. One of the nodes in the script was corrupt, so rewrote it.

3. The normal image updates automatically.


Ends up the gray bump problem was from the image format coming from the normal map generator. It uses a format called R8 and the solution was to use the ConvertFormat function to make it A8R8G8B8, which in english is a normal image.

Post by transient // Sep 9, 2008, 7:46pm

transient
Total Posts: 977
pic
The link to the script seems to be broken.

Post by clintonman // Sep 10, 2008, 1:37pm

clintonman
Total Posts: 304
pic
Oops. :o Sorry about that. The script has been uploaded.
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn