Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Joe help... getting at a texture etc. (Real Studio games Mailinglist archive)

Back to the thread list
Previous thread: Will anyone else be at the apple games kitchen?
Next thread: Goodbye....


Re: explosions   -   Jeff Quan
  Joe help... getting at a texture etc.   -   Chris Dillman
   Re: Joe help... getting at a texture etc.   -   Joseph J. Strout
   Re: Joe help... getting at a texture etc.   -   Chris Dillman
   Re: Joe help... getting at a texture etc.   -   Joseph J. Strout
   Re: Joe help... getting at a texture etc.   -   Chris Dillman
   Re: Joe help... getting at a texture etc.   -   Joseph J. Strout
   Re: Joe help... getting at a texture etc.   -   Chris Dillman
   Re: Joe help... getting at a texture etc.   -   Chris Dillman
   Re: Joe help... getting at a texture etc.   -   Frank C.
   Re: Joe help... getting at a texture etc.   -   Chris Dillman
   Re: Joe help... getting at a texture etc.   -   Chris Dillman
   Re: Joe help... getting at a texture etc.   -   Joseph J. Strout
   Re: Joe help... getting at a texture etc.   -   Joseph J. Strout
   Re: Joe help... getting at a texture etc.   -   Chris Dillman
   Re: Joe help... getting at a texture etc.   -   Chris Dillman
   Re: Joe help... getting at a texture etc.   -   Joseph J. Strout
   Re: Joe help... getting at a texture etc.   -   Chris Dillman
   Re: Joe help... getting at a texture etc.   -   Jeff Quan

Joe help... getting at a texture etc.
Date: 15.01.04 05:56 (Wed, 14 Jan 2004 22:56:51 -0600)
From: Chris Dillman

Hi

I used your declares on a getting a mesh out of an object made with.

BackGroundObj.AddShapePicture p, 1.0

mesh = GetTriMesh( BackGroundObj.GetShapeHandle( 0 ) )

Ok this seems to work.
So now what I want to know is...

An object made this way has a texture attached some how.

What is that called in quesa?

If the texture has a mask is that part of the texture or...
could the texture be told to um TILE... and the mask be just the size of the
poly....

Like the mask and texture are two separate things to quesa.

What I need to achive in the end is a Masked Quad with a reapeating
texture and a Mask...

Example you are tiling a drive way with paving stones...

the Quad represents the projected SQUARE surface of the drive way...
if say it did not have a irregular shape.

The mask represents the shape of the drive way.

Re: Joe help... getting at a texture etc.
Date: 15.01.04 16:39 (Thu, 15 Jan 2004 09:39:04 -0600)
From: Joseph J. Strout
At 10:56 PM -0600 1/14/04, Chris Dillman wrote:

> mesh = GetTriMesh( BackGroundObj.GetShapeHandle( 0 ) )
>
>Ok this seems to work.
>So now what I want to know is...
>
>An object made this way has a texture attached some how.
>
>What is that called in quesa?

It's a bit complicated. The TriMesh has an attribute set. Within
that attribute set, will be a shader attribute. Part of the shader
attribute data is the pixel map of the texture.

>If the texture has a mask is that part of the texture or...

Yes, in that case the pixel type will be ARGB32, where the "A" byte
is the alpha.

>could the texture be told to um TILE... and the mask be just the size of the
>poly....
>Like the mask and texture are two separate things to quesa.

No.

>What I need to achive in the end is a Masked Quad with a reapeating
>texture and a Mask...

Honestly, I think you should just use AddShapePicture[WithMask] to
represent the whole thing, where you've already set up the mask the
way you want it. People tend to worry a little *too* much about
texture RAM these days; modern video cards have gobs of it.

HTH,
- Joe

Re: Joe help... getting at a texture etc.
Date: 15.01.04 23:13 (Thu, 15 Jan 2004 16:13:29 -0600)
From: Chris Dillman
>At 10:56 PM -0600 1/14/04, Chris Dillman wrote:
>
>> mesh = GetTriMesh( BackGroundObj.GetShapeHandle( 0 ) )
>>
>>Ok this seems to work.
>>So now what I want to know is...
>>
>>An object made this way has a texture attached some how.
>>
>>What is that called in quesa?
>
>It's a bit complicated. The TriMesh has an attribute set. Within
>that attribute set, will be a shader attribute. Part of the shader
>attribute data is the pixel map of the texture.
>
>>If the texture has a mask is that part of the texture or...
>
>Yes, in that case the pixel type will be ARGB32, where the "A" byte
>is the alpha.
>
>>could the texture be told to um TILE... and the mask be just the size of the
>>poly....
>>Like the mask and texture are two separate things to quesa.
>
>No.
>
>>What I need to achive in the end is a Masked Quad with a reapeating
>>texture and a Mask...
>
>Honestly, I think you should just use AddShapePicture[WithMask] to
>represent the whole thing, where you've already set up the mask the
>way you want it.

Probably not clear but that is what Im trying for.

Its just that the stones in the shape need to tile.

Ok... I can make and use a mask easily in the shape I need.

But say I have a drive way and the stone pattern repeats 60 times
across the drive way then I need the pattern texture to tiles 60
times across the quad.

Thoughts?

I could do something like make a quad for each titled section of the pattern.
and only mask the needed ones... But I think this is going to scale
really bad and I would have a texture RAM problem for real...

same as if I used a real bug texture for the pattern.

It could be huge... but really only need to fit in a small area on screen...

Re: Joe help... getting at a texture etc.
Date: 15.01.04 23:37 (Thu, 15 Jan 2004 16:37:26 -0600)
From: Joseph J. Strout
At 4:13 PM -0600 1/15/04, Chris Dillman wrote:

>>Honestly, I think you should just use AddShapePicture[WithMask] to
>>represent the whole thing, where you've already set up the mask the
>>way you want it.
>
>Probably not clear but that is what Im trying for.
>
>Its just that the stones in the shape need to tile.

I think if I'd been clearer, you'd see that this isn't a problem.
You just draw your stones as many times as necessary into the picture
that represents the driveway. Then you give this to the rendering
engine, along with the mask. The *texture* doesn't tile, as far as
the 3D renderer is concerned; but you've drawn a repeating pattern of
stones in it.

>But say I have a drive way and the stone pattern repeats 60 times
>across the drive way then I need the pattern texture to tiles 60
>times across the quad.

for i = 0 to 60, DrawPicture...

>I could do something like make a quad for each titled section of the pattern.
>and only mask the needed ones... But I think this is going to scale
>really bad and I would have a texture RAM problem for real...
>
>same as if I used a real bug texture for the pattern.

I don't think it'll be a problem. How big does it need to be? 3D
cards scale textures up quite nicely, so you can probably get away
with a 256x256 picture, or 512x512 at the largest. And you can have
quite a few of those before maxing out video cards these days.

>It could be huge... but really only need to fit in a small area on screen...

If it only fits in a small area on screen, then go with even lower
resolution, perhaps 128x128.

Cheers,
- Joe

Re: Joe help... getting at a texture etc.
Date: 16.01.04 03:03 (Thu, 15 Jan 2004 20:03:40 -0600)
From: Chris Dillman
>At 4:13 PM -0600 1/15/04, Chris Dillman wrote:
>
>>>Honestly, I think you should just use AddShapePicture[WithMask] to
>>>represent the whole thing, where you've already set up the mask
>>>the way you want it.
>>
>>Probably not clear but that is what Im trying for.
>>
>>Its just that the stones in the shape need to tile.
>
>I think if I'd been clearer, you'd see that this isn't a problem.
>You just draw your stones as many times as necessary into the
>picture that represents the driveway. Then you give this to the
>rendering engine, along with the mask. The *texture* doesn't tile,
>as far as the 3D renderer is concerned; but you've drawn a repeating
>pattern of stones in it.

The stones need to be perspective projected out in to space which is
the point of trying to use the 3D engine.

Now I think what you are suggesting above will not do that.

Re: Joe help... getting at a texture etc.
Date: 16.01.04 03:43 (Thu, 15 Jan 2004 20:43:05 -0600)
From: Joseph J. Strout
At 8:03 PM -0600 1/15/04, Chris Dillman wrote:

>The stones need to be perspective projected out in to space which is
>the point of trying to use the 3D engine.

Right. They will be.

>Now I think what you are suggesting above will not do that.

Yes it will. I see I haven't explained it clearly. Let me try again:

1. Make a NewPicture, big enough to hold the *entire* texture (and
shape) of your driveway.

2. Into this, draw all the stones needed for the entire driveway.

3. In another picture (or the mask of that one), draw the driveway shape.

4. Use Object3D.AddShapePictureWithMask to turn these into a 3D model
of your driveway.

5. Add this to your Rb3DSpace so that it will be rendered on screen.

HTH,
- Joe

Re: Joe help... getting at a texture etc.
Date: 16.01.04 04:00 (Thu, 15 Jan 2004 21:00:12 -0600)
From: Chris Dillman
>At 8:03 PM -0600 1/15/04, Chris Dillman wrote:
>
>>The stones need to be perspective projected out in to space which
>>is the point of trying to use the 3D engine.
>
>Right. They will be.
>
>>Now I think what you are suggesting above will not do that.
>
>Yes it will. I see I haven't explained it clearly. Let me try again:
>
>1. Make a NewPicture, big enough to hold the *entire* texture (and
>shape) of your driveway.
>
>2. Into this, draw all the stones needed for the entire driveway.
>
>3. In another picture (or the mask of that one), draw the driveway shape.
>
>4. Use Object3D.AddShapePictureWithMask to turn these into a 3D
>model of your driveway.
>
>5. Add this to your Rb3DSpace so that it will be rendered on screen.

Ah ok...
At first I thought this was wrong..

But no you are correct.

I think this might be work well.
Possibly fast even.

Thanks joe...

3 of us had been thinking on this for weeks and I was only getting
Soooo close...

Re: Joe help... getting at a texture etc.
Date: 16.01.04 07:19 (Fri, 16 Jan 2004 00:19:06 -0600)
From: Chris Dillman

OK I got most of the new approach up and running.

Its looking good so far.

Im having a texturing problem I don't get.

Im making the quad with a texture and a black on white mask.

what I get on screen is the texture being masked to the poly correct..
BUT the not masked parts are drawing WHITE and not see through...
while the rest is the correctly masked texture on the quad.

this is RB 4.5.3

Re: Joe help... getting at a texture etc.
Date: 16.01.04 08:20 (Fri, 16 Jan 2004 02:20:57 -0500)
From: Frank C.
On 16-Jan-04, at 1:19 AM, Chris Dillman wrote:

> Im making the quad with a texture and a black on white mask.
>
> what I get on screen is the texture being masked to the poly correct..
> BUT the not masked parts are drawing WHITE and not see through...
> while the rest is the correctly masked texture on the quad.

QD3D/Quesa use additive blending for alphas, so you have to
pre-multiply your mask for black areas to draw totally transparent.
Filling the picture with black before drawing your texture to it should
do it.

Frank.

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

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

Re: Joe help... getting at a texture etc.
Date: 16.01.04 09:36 (Fri, 16 Jan 2004 02:36:10 -0600)
From: Chris Dillman
>On 16-Jan-04, at 1:19 AM, Chris Dillman wrote:
>
>>Im making the quad with a texture and a black on white mask.
>>
>>what I get on screen is the texture being masked to the poly correct..
>>BUT the not masked parts are drawing WHITE and not see through...
>>while the rest is the correctly masked texture on the quad.
>
>QD3D/Quesa use additive blending for alphas, so you have to
>pre-multiply your mask for black areas to draw totally transparent.
>Filling the picture with black before drawing your texture to it
>should do it.

How will that work.

If I fill my picture with black the texture will be drawn over it.

Or do I not get what you are saying?

Where is that web page with an example?

Im looking at an old texture I have here that does work...
A sphere from black to red...
I think I use a PURE white mask with it to get it to have the black turn white.

I noticed that between 4.5.3 and 5.5 the texture/Mask behavior seems
to be reversed?

Re: Joe help... getting at a texture etc.
Date: 16.01.04 09:55 (Fri, 16 Jan 2004 02:55:47 -0600)
From: Chris Dillman

1. I have a texture I generated in RB by drawing some bitmaps...
stone tiles to be exact.

2. I have a currently black mask I generated by filling a polygon in RB.

Now how do I get these combined to do anything useful in RB3D.

3. Im really just going for cookie cutter transparency.
Not actual translucency.
I could do something that uses the mask to pre process the texture so
that all the transparent parts end up white and use the non masking
call to build the 3D object. But I would still like to figure out how
to do this the other way.

Also on this subject does any one actually like QD3D blending style.
It seems counter intuitive to me and I can't recall ever seeing it
used any where else but in QD3D.

Im thinking that it would be nice to be able to switch the blending
to a different less annoying blending mode. Which Im assuming Quesa
does or can easily support.

Re: Joe help... getting at a texture etc.
Date: 16.01.04 15:37 (Fri, 16 Jan 2004 08:37:31 -0600)
From: Joseph J. Strout
At 12:19 AM -0600 1/16/04, Chris Dillman wrote:

>what I get on screen is the texture being masked to the poly correct..
>BUT the not masked parts are drawing WHITE and not see through...
>while the rest is the correctly masked texture on the quad.

I suggest posting the relevant code snippet. Otherwise we have to
just take guesses at what might be wrong with it.

Best,
- Joe

Re: Joe help... getting at a texture etc.
Date: 16.01.04 15:39 (Fri, 16 Jan 2004 08:39:26 -0600)
From: Joseph J. Strout
At 2:55 AM -0600 1/16/04, Chris Dillman wrote:

>3. Im really just going for cookie cutter transparency.
>Not actual translucency.

In that case, use a 16-bit picture, with the areas you want to be
transparent set to solid white.

>Also on this subject does any one actually like QD3D blending style.

Oh yes, it's very powerful. I'm using it (well, OK, the artist I
work with -- Jeff Quan -- is using it) to great effect in some games
we're working on.

>Im thinking that it would be nice to be able to switch the blending
>to a different less annoying blending mode. Which Im assuming Quesa
>does or can easily support.

No, it doesn't and it can't easily do so.

Cheers,
- Joe

Re: Joe help... getting at a texture etc.
Date: 16.01.04 18:11 (Fri, 16 Jan 2004 11:11:53 -0600)
From: Chris Dillman
>At 2:55 AM -0600 1/16/04, Chris Dillman wrote:
>
>>3. Im really just going for cookie cutter transparency.
>>Not actual translucency.
>
>In that case, use a 16-bit picture, with the areas you want to be
>transparent set to solid white.

Ok I went back to the AddShapePicture and pre computed the mask onto
the texture.

That worked fine.

and I realize that I think my VERY first attempt was like this with one small
bug.... which of course makes me go ARRRGGGGG.... many hours later :)

Re: Joe help... getting at a texture etc.
Date: 16.01.04 18:12 (Fri, 16 Jan 2004 11:12:24 -0600)
From: Chris Dillman
>
>Oh yes, it's very powerful. I'm using it (well, OK, the artist I
>work with -- Jeff Quan -- is using it) to great effect in some games
>we're working on.

What are you making?

Re: Joe help... getting at a texture etc.
Date: 16.01.04 18:18 (Fri, 16 Jan 2004 11:18:09 -0600)
From: Joseph J. Strout
At 11:12 AM -0600 1/16/04, Chris Dillman wrote:

>>Oh yes, it's very powerful. I'm using it (well, OK, the artist I
>>work with -- Jeff Quan -- is using it) to great effect in some
>>games we're working on.
>
>What are you making?

I can't say, it's very hush-hush. But it'll be out soon, so just stay tuned...

Cheers,
- Joe

Re: Joe help... getting at a texture etc.
Date: 16.01.04 18:51 (Fri, 16 Jan 2004 11:51:41 -0600)
From: Chris Dillman
>At 11:12 AM -0600 1/16/04, Chris Dillman wrote:
>
>>>Oh yes, it's very powerful. I'm using it (well, OK, the artist I
>>>work with -- Jeff Quan -- is using it) to great effect in some
>>>games we're working on.
>>
>>What are you making?
>
>I can't say, it's very hush-hush. But it'll be out soon, so just
>stay tuned...

"REAL GAMES" are based on hype. ;)
You should be telling everyone.

Re: Joe help... getting at a texture etc.
Date: 16.01.04 18:33 (Fri, 16 Jan 2004 09:33:11 -0800)
From: Jeff Quan

On Friday, January 16, 2004, at 06:00 AM, REALbasic Games wrote:

> Subject: Re: Joe help... getting at a texture etc.
> From: "Chris Dillman" <<email address removed>>
> Date: Fri, 16 Jan 2004 02:36:10 -0600
>
> How will that work.
>
> If I fill my picture with black the texture will be drawn over it.
>
> Or do I not get what you are saying?
>
> Where is that web page with an example?

Try my explanation of alpha masks at
<http://www.geocities.com/jeffq_cnet/Meshwork/alphamask.html>

Hmm. I see that I'll need to update that page a bit for the new Quesa,
but it's still valid.


=Jeff Quan
<email address removed>

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

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