Xojo Conferences
XDCMay2019MiamiUSA

Matte Surfaces (Real Studio games Mailinglist archive)

Back to the thread list
Previous thread: School Bus (was Re: Matte Surfaces)
Next thread: Declaring to XOpenDisplay, XCloseDisplay, and DefaultScreen (Linux)


[ANN] Preview of RBD 2.4   -   Marc Zeedar
  Matte Surfaces   -   Jesse Simko
   Re: Matte Surfaces   -   Lars Jensen
   Re: Matte Surfaces   -   Frank Condello
   Re: Matte Surfaces   -   Jesse Simko
    Re: Matte Surfaces   -   Seth Duke
   Re: Matte Surfaces   -   Frank Condello
    Re: Matte Surfaces   -   Lars Jensen
     Re: Matte Surfaces   -   Jesse Simko
      Re: Matte Surfaces   -   Lars Jensen
       Re: Matte Surfaces   -   Jesse Simko
        Re: Matte Surfaces   -   Lars Jensen
         Re: Matte Surfaces   -   Jesse Simko
         Re: Matte Surfaces   -   Nick Lockwood
         Re: Matte Surfaces   -   Jesse Simko
       Re: Matte Surfaces   -   John Tsombakos
       Re: Matte Surfaces   -   Jesse Simko
       Re: Slow RB3D loading (Was: Matte Surfaces)   -   Joseph Nastasi
   Re: Matte Surfaces   -   Joseph J. Strout
   Re: Matte Surfaces   -   Joseph J. Strout
   Re: Matte Surfaces   -   Jeff Quan
   Re: Matte Surfaces   -   Jesse Simko
   Re: Matte Surfaces   -   Joseph J. Strout
   Re: Matte Surfaces   -   Jeff Quan
   Re: Matte Surfaces   -   Frank Condello
   Multitexturing (Was: Matte Surfaces)   -   Frank Condello

Matte Surfaces
Date: 11.03.05 06:54 (Fri, 11 Mar 2005 00:54:20 -0500)
From: Jesse Simko
Hi, I've been lurking here for a while, learning the basics of RB3D. I
have started making a driving simulation and I've concentrated mainly
on physics thus far, but I was sidetracked by a rendering related
issue: when viewing the vehicles that I made (school busses; see
http://sawbladesoftware.com/other/schoolbus.jpg for a screenshot) from
certain angles, the metallic edges "catch the light" and shine
brightly. It's a nice effect, but it's one that I don't have much
control over. I found that the landscape, which should naturally be a
less shiny surface, also reflects light when viewed from certain
angles. At times, it becomes nearly pure white. I would like for any
given polygonal surface to remain the same color regardless of the
camera's orientation.
I was wondering if anyone could tell me whether there is a way to
control the "shininess" of objects. I know that I can avoid this issue
by setting an Object3D's nullShader property to True, but I still want
to take advantage of real time lighting if possible.
I am using Lightwave for modeling and Meshwork for texturing. My video
card is a GeForceFX 5200.
Thanks for the help,
Jesse

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 11.03.05 07:00 (Fri, 11 Mar 2005 01:00:25 -0500)
From: Lars Jensen
> I have started making a driving simulation...

Excellent! When do we get to try it out?

(Sorry, I have no idea how to solve the reflectivity problem...)

lj
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 11.03.05 07:54 (Fri, 11 Mar 2005 01:54:22 -0500)
From: Frank Condello
On 11-Mar-05, at 12:54 AM, Jesse Simko wrote:

> ...from certain angles, the metallic edges "catch the light" and shine
> brightly. It's a nice effect, but it's one that I don't have much
> control over.

What you're seeing is a specular highlight (Phong shading), and there's
two ways to get rid of it: Set the object's specular colour to black
(easiest way), or apply a Lambert shader to the scene or to each object
(the "proper" way).

Unfortunately knowing what to do and actually doing it are two
different things. You can:

1). Use a 3DMF editor/exporter that can control specular attributes
and/or illumination shaders (I can't think of one off the top of my
head).

2). If you can export your 3DMF models to text format, it's fairly easy
to change the specular colour by hand in a plain text editor.

3). Use declares to adjust the specularity or apply a Lambert shader at
runtime.

For #3 you might want to check out my Quesa Wrappers
<http://developer.chaoticbox.com/>. They allow you to use either
approach.

On a similar note I've been wondering for a while now why Quesa/RB3D
default to Phong shading, as Lambert seems to be more logical as a
default setting. Might be a QD3D legacy...

Frank.
------------
Open Source RB Plugins and Classes
<http://developer.chaoticbox.com>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 11.03.05 08:55 (Fri, 11 Mar 2005 02:55:40 -0500)
From: Jesse Simko

On Mar 11, 2005, at 1:54 AM, Frank Condello wrote:

> On 11-Mar-05, at 12:54 AM, Jesse Simko wrote:
>
>> ...from certain angles, the metallic edges "catch the light" and
>> shine brightly. It's a nice effect, but it's one that I don't have
>> much control over.
>
> What you're seeing is a specular highlight (Phong shading), and
> there's two ways to get rid of it: Set the object's specular colour to
> black (easiest way), or apply a Lambert shader to the scene or to each
> object (the "proper" way).
>
> Unfortunately knowing what to do and actually doing it are two
> different things. You can:
>
> 1). Use a 3DMF editor/exporter that can control specular attributes
> and/or illumination shaders (I can't think of one off the top of my
> head).
>
> 2). If you can export your 3DMF models to text format, it's fairly
> easy to change the specular colour by hand in a plain text editor.
>
> 3). Use declares to adjust the specularity or apply a Lambert shader
> at runtime.
>
> For #3 you might want to check out my Quesa Wrappers
> <http://developer.chaoticbox.com/>. They allow you to use either
> approach.
>
> On a similar note I've been wondering for a while now why Quesa/RB3D
> default to Phong shading, as Lambert seems to be more logical as a
> default setting. Might be a QD3D legacy...
>
> Frank.
> ------------

Thanks Frank, that was a huge help. I just inserted the following line
into my 3DMF file:

SpecularColor( 0 0 0 )

and the object gained a matte surface.
For those who are interested, the application I made can be found at
http://www.sawbladesoftware.com/other/schoolbus.sit (it's very early in
development, but the physics are working pretty well so far...)
Jesse

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 11.03.05 16:27 (Fri, 11 Mar 2005 10:27:57 -0500)
From: Seth Duke
Wow! That's really awesome! I love the tilting of the bus when you first
accelerate and brake.

-Seth

On 3/11/05 2:55 AM, "Jesse Simko" <<email address removed>> wrote:

>
> On Mar 11, 2005, at 1:54 AM, Frank Condello wrote:
>
>> On 11-Mar-05, at 12:54 AM, Jesse Simko wrote:
>>
>>> ...from certain angles, the metallic edges "catch the light" and
>>> shine brightly. It's a nice effect, but it's one that I don't have
>>> much control over.
>>
>> What you're seeing is a specular highlight (Phong shading), and
>> there's two ways to get rid of it: Set the object's specular colour to
>> black (easiest way), or apply a Lambert shader to the scene or to each
>> object (the "proper" way).
>>
>> Unfortunately knowing what to do and actually doing it are two
>> different things. You can:
>>
>> 1). Use a 3DMF editor/exporter that can control specular attributes
>> and/or illumination shaders (I can't think of one off the top of my
>> head).
>>
>> 2). If you can export your 3DMF models to text format, it's fairly
>> easy to change the specular colour by hand in a plain text editor.
>>
>> 3). Use declares to adjust the specularity or apply a Lambert shader
>> at runtime.
>>
>> For #3 you might want to check out my Quesa Wrappers
>> <http://developer.chaoticbox.com/>. They allow you to use either
>> approach.
>>
>> On a similar note I've been wondering for a while now why Quesa/RB3D
>> default to Phong shading, as Lambert seems to be more logical as a
>> default setting. Might be a QD3D legacy...
>>
>> Frank.
>> ------------
>
> Thanks Frank, that was a huge help. I just inserted the following line
> into my 3DMF file:
>
> SpecularColor( 0 0 0 )
>
> and the object gained a matte surface.
> For those who are interested, the application I made can be found at
> http://www.sawbladesoftware.com/other/schoolbus.sit (it's very early in
> development, but the physics are working pretty well so far...)
> Jesse
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 11.03.05 10:05 (Fri, 11 Mar 2005 04:05:10 -0500)
From: Frank Condello
On 11-Mar-05, at 2:55 AM, Jesse Simko wrote:

> For those who are interested, the application I made can be found at
> http://www.sawbladesoftware.com/other/schoolbus.sit (it's very early
> in development, but the physics are working pretty well so far...)

You've got some nice vehicle physics going there! All you need now is a
hood cam and some critters to run over ;)

Frank.
------------
Open Source RB Plugins and Classes
<http://developer.chaoticbox.com>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 11.03.05 20:38 (Fri, 11 Mar 2005 14:38:38 -0500)
From: Lars Jensen
> For those who are interested, the application I made can be found at
> http://www.sawbladesoftware.com/other/schoolbus.sit

That is great! Really nice balance between realism and controllable chaos.

I don't suppose you're going to make this open-source by any chance...?

lj
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 12.03.05 10:30 (Sat, 12 Mar 2005 04:30:52 -0500)
From: Jesse Simko

On Mar 11, 2005, at 2:38 PM, Lars Jensen wrote:

>> For those who are interested, the application I made can be found at
>> http://www.sawbladesoftware.com/other/schoolbus.sit
>
> That is great! Really nice balance between realism and controllable
> chaos.
>
> I don't suppose you're going to make this open-source by any chance...?
>
> lj
> _______________________________________________

I put the source code for the school bus game at
http://sawbladesoftware.com/other/schoolbus/
I don't know if the code base will be of much help to anyone since it's
so full of holes, but it does include a potentially useful "math"
module with lots of often-used formulas. I had a really hard time with
some of the math (like how to figure out if two lines intersect) and I
wouldn't want anyone else to have to go through such trouble. So,
enjoy!
Jesse

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 12.03.05 22:10 (Sat, 12 Mar 2005 16:10:01 -0500)
From: Lars Jensen
> I put the source code for the school bus game at
> http://sawbladesoftware.com/other/schoolbus/
> I don't know if the code base will be of much help to anyone since it's
> so full of holes, but it does include a potentially useful "math"
> module with lots of often-used formulas. I had a really hard time with
> some of the math (like how to figure out if two lines intersect) and I
> wouldn't want anyone else to have to go through such trouble. So,
> enjoy!

Zowie! This is awesome...thanks for posting it! According to the download
page you retain copyrights on all this stuff, so it wouldn't be proper for
anyone to re-use any of it. Is that your intent? (The above seems to imply
otherwise.)

Also, what version of RB are you using?

lj
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 13.03.05 19:23 (Sun, 13 Mar 2005 13:23:13 -0500)
From: Jesse Simko

On Mar 12, 2005, at 4:10 PM, Lars Jensen wrote:

>> I put the source code for the school bus game at
>> http://sawbladesoftware.com/other/schoolbus/
>> I don't know if the code base will be of much help to anyone since
>> it's
>> so full of holes, but it does include a potentially useful "math"
>> module with lots of often-used formulas. I had a really hard time with
>> some of the math (like how to figure out if two lines intersect) and I
>> wouldn't want anyone else to have to go through such trouble. So,
>> enjoy!
>
> Zowie! This is awesome...thanks for posting it! According to the
> download
> page you retain copyrights on all this stuff, so it wouldn't be proper
> for
> anyone to re-use any of it. Is that your intent? (The above seems to
> imply
> otherwise.)
>
> Also, what version of RB are you using?
>
> lj
>

By all means, modify the code and re-use it. I just put the copyright
symbol on there because I'd like to maintain the ability to eventually
develop it into a real game.
One word of caution: someone on the iDevGames forum told me about a
vehicle physics tutorial (available at
http://home.planet.nl/~monstrous/tutcar.html) that reveals all the
proper math formulas, and in hindsight I realize that if I had known
about it I could have done a better job with the physics of this game.

Some people have pointed out that it takes a long time for the program
to load (up to 15 seconds on a G3.) I was trying to figure out what the
bottleneck is... the models themselves seemed to load in a very short
time (just a fraction of a second), but applying them to the RB3D
surface and displaying that first frame took a while. Is this
consistent with what others have experienced?
Jesse

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 14.03.05 00:49 (Sun, 13 Mar 2005 18:49:41 -0500)
From: Lars Jensen
> By all means, modify the code and re-use it.

Thanks!

> One word of caution: someone on the iDevGames forum told me about a
> vehicle physics tutorial (available at
> http://home.planet.nl/~monstrous/tutcar.html

Nice.

BTW, you never mentioned which RB version you use...

lj
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 14.03.05 19:41 (Mon, 14 Mar 2005 13:41:19 -0500)
From: Jesse Simko
I've been using RB 5.5.4.
Looking forward to "RB 2005" though:)
By the way, I found another reason why my RB3D app was taking a long
time to load; in order to speed up the process of determining which
landscape polygon a given object was resting on, the game world had
been divided into a grid of 10000 by 10000 squares, each of which
measured 100 by 100 meters. Any of those squares that were found to
have contained one or more landscape polygons was instantiated. But it
took a very long time just to bring into existence an array of 10000 x
10000 nil objects in the first place. So I compromised and reduced the
size of the world to 1000 by 1000 squares. Now that stuff loads 100
times faster but the potential size of the world is "only" 10,000
square kilometers instead of a million square kilometers. Oh well ;)
Jesse

>
> Nice.
>
> BTW, you never mentioned which RB version you use...
>
> lj
> _______________________________________________

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 15.03.05 02:23 (Tue, 15 Mar 2005 01:23:44 +0000)
From: Nick Lockwood
This is hardly surprising,

A nil object in realbasic is represented by 4 bytes, so an array of
10,000*10,000*4 = 400,000,000 i.e. 400 megabytes.

So to instantiate such an array you basically have to set 400 megabytes
of ram to zero, and the chances are that your machine doesn't have a
single contiguous block of 400 megabytes of ram free at any given point
in time, so that translates to virtual memory being used.

Try loading 400 megabytes of data from disk into ram and see how long
it takes.

Can I suggest exploring a different algorithmic approach? Look up quad
trees on google. Quad trees are basically structures comprised of
squares, each of which can contain a value and/or four subsquares, each
of which can contain a value and/or four subsquares.... etc.

Basically if a quarter of your map had no polygons in it, you could
represent that with a single quad structure with no substructures. If
you found that it did have some polygons in, you would then split it
into four, and check each of those for polygons, and so on.

By using a quad tree structure you could quickly scan your landcape for
polygons at an arbitrary level of detail without needing nearly so much
data.

Nick

On 14 Mar 2005, at 18:41, Jesse Simko wrote:

> I've been using RB 5.5.4.
> Looking forward to "RB 2005" though:)
> By the way, I found another reason why my RB3D app was taking a long
> time to load; in order to speed up the process of determining which
> landscape polygon a given object was resting on, the game world had
> been divided into a grid of 10000 by 10000 squares, each of which
> measured 100 by 100 meters. Any of those squares that were found to
> have contained one or more landscape polygons was instantiated. But it
> took a very long time just to bring into existence an array of 10000 x
> 10000 nil objects in the first place. So I compromised and reduced the
> size of the world to 1000 by 1000 squares. Now that stuff loads 100
> times faster but the potential size of the world is "only" 10,000
> square kilometers instead of a million square kilometers. Oh well ;)
> Jesse
>
>>
>> Nice.
>>
>> BTW, you never mentioned which RB version you use...
>>
>> lj
>> _______________________________________________
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 15.03.05 07:16 (Tue, 15 Mar 2005 01:16:36 -0500)
From: Jesse Simko
Wow, thanks Nick; it's nice to know how REALbasic works "under the
hood". I've heard of the concept of Quad trees before... I should learn
about more them. Sounds like they could apply to lots of parts of the
program, not just landscapes.
I think you're right about how the programming language is rarely to
blame for slow performance. There's usually something that can be done
to improve an algorithm.
As for the current approach, it seems to work ok once the program has
loaded; I borrowed Joe's FPS example code for determining which
landscape triangle a given point rests on... but it only deals with the
triangles within a single block (out of the 1000 x 1000 blocks). If the
triangle isn't in the expected block, it starts examining nearby
blocks, moving outward toward increasingly distant blocks that are less
and less likely to contain the solution.
Anyway, if I get the time I'll look up quad trees; I see how they can
help, but without really knowing anything, it sounds like a real
programming challenge. I imagine a scenario where each instance of the
"QuadTree" class would have 4 properties; and each property is itself a
QuadTree... Recursion makes my brain hurt!
Jesse

On Mar 14, 2005, at 8:23 PM, Nick Lockwood wrote:

> This is hardly surprising,
>
> A nil object in realbasic is represented by 4 bytes, so an array of
> 10,000*10,000*4 = 400,000,000 i.e. 400 megabytes.
>
> So to instantiate such an array you basically have to set 400
> megabytes of ram to zero, and the chances are that your machine
> doesn't have a single contiguous block of 400 megabytes of ram free at
> any given point in time, so that translates to virtual memory being
> used.
>
> Try loading 400 megabytes of data from disk into ram and see how long
> it takes.
>
> Can I suggest exploring a different algorithmic approach? Look up quad
> trees on google. Quad trees are basically structures comprised of
> squares, each of which can contain a value and/or four subsquares,
> each of which can contain a value and/or four subsquares.... etc.
>
> Basically if a quarter of your map had no polygons in it, you could
> represent that with a single quad structure with no substructures. If
> you found that it did have some polygons in, you would then split it
> into four, and check each of those for polygons, and so on.
>
> By using a quad tree structure you could quickly scan your landcape
> for polygons at an arbitrary level of detail without needing nearly so
> much data.
>
> Nick
>
> On 14 Mar 2005, at 18:41, Jesse Simko wrote:
>
>> I've been using RB 5.5.4.
>> Looking forward to "RB 2005" though:)
>> By the way, I found another reason why my RB3D app was taking a long
>> time to load; in order to speed up the process of determining which
>> landscape polygon a given object was resting on, the game world had
>> been divided into a grid of 10000 by 10000 squares, each of which
>> measured 100 by 100 meters. Any of those squares that were found to
>> have contained one or more landscape polygons was instantiated. But
>> it took a very long time just to bring into existence an array of
>> 10000 x 10000 nil objects in the first place. So I compromised and
>> reduced the size of the world to 1000 by 1000 squares. Now that stuff
>> loads 100 times faster but the potential size of the world is "only"
>> 10,000 square kilometers instead of a million square kilometers. Oh
>> well ;)
>> Jesse
>>
>>>
>>> Nice.
>>>
>>> BTW, you never mentioned which RB version you use...
>>>
>>> lj
>>> _______________________________________________
>>
>> _______________________________________________
>> Unsubscribe or switch delivery mode:
>> <http://www.realsoftware.com/support/listmanager/>
>>
>> Search the archives of this list here:
>> <http://support.realsoftware.com/listarchives/lists.html>
>>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 13.03.05 19:29 (Sun, 13 Mar 2005 13:29:06 -0500)
From: John Tsombakos
I tried to build the Schoolbus demo, but it complained that it was
missing something - GetCarbonBundle or something (not on the machine
with the code). Is there a plugin necessary?

On Mar 13, 2005, at 1:23 PM, Jesse Simko wrote:

>
> On Mar 12, 2005, at 4:10 PM, Lars Jensen wrote:
>
>>> I put the source code for the school bus game at
>>> http://sawbladesoftware.com/other/schoolbus/
>>> I don't know if the code base will be of much help to anyone since
>>> it's
>>> so full of holes, but it does include a potentially useful "math"
>>> module with lots of often-used formulas. I had a really hard time
>>> with
>>> some of the math (like how to figure out if two lines intersect) and
>>> I
>>> wouldn't want anyone else to have to go through such trouble. So,
>>> enjoy!

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 13.03.05 20:29 (Sun, 13 Mar 2005 14:29:05 -0500)
From: Jesse Simko
Sorry about that. I think the problem is that the program uses a
REALbasic plugin called MacAppProcess (available from
http://www.mile23.com/files/MacAppProcess.sit) that lets an application
retrieve files from its own package. If you don't feel like installing
the plugin, you can replace this line of code:
f = App.CarbonBundleResource("Game Data")
with this:
f = getFolderItem("Game Data")
Hope that helps,
Jesse

On Mar 13, 2005, at 1:29 PM, John Tsombakos wrote:

> I tried to build the Schoolbus demo, but it complained that it was
> missing something - GetCarbonBundle or something (not on the machine
> with the code). Is there a plugin necessary?
>
> On Mar 13, 2005, at 1:23 PM, Jesse Simko wrote:
>
>>
>> On Mar 12, 2005, at 4:10 PM, Lars Jensen wrote:
>>
>>>> I put the source code for the school bus game at
>>>> http://sawbladesoftware.com/other/schoolbus/
>>>> I don't know if the code base will be of much help to anyone since
>>>> it's
>>>> so full of holes, but it does include a potentially useful "math"
>>>> module with lots of often-used formulas. I had a really hard time
>>>> with
>>>> some of the math (like how to figure out if two lines intersect)
>>>> and I
>>>> wouldn't want anyone else to have to go through such trouble. So,
>>>> enjoy!
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 11.03.05 15:35 (Fri, 11 Mar 2005 08:35:53 -0600)
From: Joseph J. Strout
At 1:54 AM -0500 3/11/05, Frank Condello wrote:

>On a similar note I've been wondering for a while now why Quesa/RB3D
>default to Phong shading, as Lambert seems to be more logical as a
>default setting. Might be a QD3D legacy...

Not really; I think that was just the way the original Rb3D plug-in
was written because that's the renderer I generally use. I certainly
could see the benefit of making this an option, though I'm not sure
if changing the default at this point would be a good idea.

Still, maybe this would be a good item for the Rb3D FAQ -- even
without the full Quesa Wrappers, creating a Lambert shader and
sticking it into a group should be just half a page or so of code, I
would think. Anybody feel like hashing out the details and
contributing it to the FAQ?

To the original poster: for the landscape, the "best" solution (in
terms of quality and rendering speed) would probably be to paint your
landscape texture with all the shading already in it, then put it
into your game with NullShader=True. This will allow you to even
have shadows for buildings and such (just don't make them too
obvious, or the lack of shadows on the busses will stand out). It
will also give the correct appearance regardless of the camera angle.

The exception of course is if you have any water; that should be a
separate model rendered with the standard Phong shading, so it
appears shiny.

Say, the next-to-last paragraph above suggests a nifty tool: a
"texture baker" that takes a textured 3DMF, allows you to place it in
a scene with lights adjusted how you want them (presumably, the same
way as in the real app), and then writes out a modified 3DMF with the
textures already shaded according to the lighting.

Best,
- Joe

Re: Matte Surfaces
Date: 11.03.05 15:39 (Fri, 11 Mar 2005 08:39:30 -0600)
From: Joseph J. Strout
At 2:55 AM -0500 3/11/05, Jesse Simko wrote:

>Thanks Frank, that was a huge help. I just inserted the following
>line into my 3DMF file:
>
>SpecularColor( 0 0 0 )
>
>and the object gained a matte surface.

That's cool -- I'm glad you found such an easy solution. This really
points out the benefit of having a 3D file format with both text and
binary forms -- in text form, you can do these sort of tweaks so
easily. And then you can just run it through Anatas when you want
the binary equivalent.

>For those who are interested, the application I made can be found at
>http://www.sawbladesoftware.com/other/schoolbus.sit (it's very early
>in development, but the physics are working pretty well so far...)

I'll check this out over lunch -- sounds very neat!

Best,
- Joe

Re: Matte Surfaces
Date: 11.03.05 17:58 (Fri, 11 Mar 2005 08:58:34 -0800)
From: Jeff Quan
Wow! You've got a really cool driving sim in the making. I'm ready to
do a flying jump off of a hill (cool bus -- it handles like a 4x4 :)

On Mar 10, 2005, at 11:55 PM, Jesse Simko wrote:
> For those who are interested, the application I made can be found at
> http://www.sawbladesoftware.com/other/schoolbus.sit (it's very early
> in development, but the physics are working pretty well so far...)
> Jesse

=Jeff Quan
<email address removed>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 11.03.05 19:18 (Fri, 11 Mar 2005 13:18:13 -0500)
From: Jesse Simko
> To the original poster: for the landscape, the "best" solution (in
> terms of quality and rendering speed) would probably be to paint your
> landscape texture with all the shading already in it, then put it into
> your game with NullShader=True. This will allow you to even have
> shadows for buildings and such (just don't make them too obvious, or
> the lack of shadows on the busses will stand out). It will also give
> the correct appearance regardless of the camera angle.

Thanks for the suggestion. I made a landscape texture that emphasized
the contour of the hills by darkening the slopes facing West and
lightening slopes facing East. One problem with baking shading into a
texture is that the texture is no longer suited for tiling.
I tried another approach: two landscape models stacked very closely on
top of each other. The bottom one was given a tiled grass texture, and
the top one had a non-tiled black shadow texture with an alpha mask to
show off its contour. That seemed to work, but it doubles the number of
polygons, which seems wasteful. And semitransparent objects seem to be
incompatible with fog.
Does anyone know if it's possible to do proper multitexturing with
Declare statements?
Jesse

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 11.03.05 19:52 (Fri, 11 Mar 2005 12:52:12 -0600)
From: Joseph J. Strout
At 1:18 PM -0500 3/11/05, Jesse Simko wrote:

>Thanks for the suggestion. I made a landscape texture that
>emphasized the contour of the hills by darkening the slopes facing
>West and lightening slopes facing East. One problem with baking
>shading into a texture is that the texture is no longer suited for
>tiling.

That's a very good point.

>I tried another approach: two landscape models stacked very closely
>on top of each other. The bottom one was given a tiled grass
>texture, and the top one had a non-tiled black shadow texture with
>an alpha mask to show off its contour. That seemed to work, but it
>doubles the number of polygons, which seems wasteful.

True; this is the sort of thing multitexturing is good for, at least
for video cards that support it, but I don't think it's very easy to
do yet.

> And semitransparent objects seem to be incompatible with fog.

This may not be an issue with the latest build of Quesa (1.6d18 I
think). It's worth a try anyway.

But, given the alternatives, it seems like in this case you might be
better off with just the matte lighted surface with tiled texture.

Best,
- Joe

Re: Matte Surfaces
Date: 11.03.05 19:58 (Fri, 11 Mar 2005 10:58:53 -0800)
From: Jeff Quan
On Mar 11, 2005, at 10:18 AM, Jesse Simko wrote:
> I tried another approach: two landscape models stacked very closely on
> top of each other. The bottom one was given a tiled grass texture, and
> the top one had a non-tiled black shadow texture with an alpha mask to
> show off its contour. That seemed to work, but it doubles the number
> of polygons, which seems wasteful. And semitransparent objects seem to
> be incompatible with fog.

The technique you describe above is used in Renegades in certain spots,
with the semitransparent mesh contained within the model it's
shadowing. What I've found is that it's not the doubling of polygons
which is a killer, it's the number of semitransparent objects in view
at any one time. I brought an early version of Renegades to a crawl
doing that before switching back to opaque models.

However, with the latest Quesa (1.6d20), semitransparent objects have
been greatly improved, even in fog.

=Jeff Quan
<email address removed>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Matte Surfaces
Date: 11.03.05 21:19 (Fri, 11 Mar 2005 15:19:45 -0500)
From: Frank Condello
On 11-Mar-05, at 9:35 AM, Joseph J. Strout wrote:

> At 1:54 AM -0500 3/11/05, Frank Condello wrote:
>
>> On a similar note I've been wondering for a while now why Quesa/RB3D
>> default to Phong shading, as Lambert seems to be more logical as a
>> default setting. Might be a QD3D legacy...
>
> Not really; I think that was just the way the original Rb3D plug-in
> was written because that's the renderer I generally use. I certainly
> could see the benefit of making this an option, though I'm not sure if
> changing the default at this point would be a good idea.

I agree it's probably late to change the default...

> Still, maybe this would be a good item for the Rb3D FAQ -- even
> without the full Quesa Wrappers, creating a Lambert shader and
> sticking it into a group should be just half a page or so of code, I
> would think. Anybody feel like hashing out the details and
> contributing it to the FAQ?

Well I can post sample code to show how to do this with the wrappers,
but writing self-contained Quesa declares is a little mundane for me at
this point ;)

However, this is probably only several lines of code to add to RB3D
itself (wink, wink). Object3D has a Nullshader property so the code is
basically already there, unfortunately Nullshader is a boolean and
illumination shaders are mutually exclusive. It would be nice to have
an "IlluminationShader As Integer" property instead, with some class
constants for Null, Lambert, and Phong. Perhaps Nullshader can be
deprecated and used only when IlluminationShader = 0? I'll submit a
feature request if it'll make a difference.

I can add this to the next Quesa Wrappers release via class extensions
if anyone thinks it's a good idea, but there are still times when
you'll want to dig into a shape's display groups and apply shaders
per-mesh (allows for things like a matte character carrying a shiny
sword as a single 3DMF, for example).

Frank.
------------
Open Source RB Plugins and Classes
<http://developer.chaoticbox.com>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>