Masked Entity Portions?

Blitz3D Forums/Blitz3D Beginners Area/Masked Entity Portions?

Buggy(Posted 2006) [#1]
I'll try to explain this as best as I can. Is there a simple way to make it so that when I texture an entity using a masked texture, the masked parts are not only not seen but make the entity completely see-through?

Think of a basketball. You know those black rubber seams on basketballs? Now take away the ball. I just want the seams. I suppose another way to explain this is to think of a sphere with wireframe mode on, but I would like to be able to choose what the visible part looks like instead of just showing every vertex.

Is this clear?


Ross C(Posted 2006) [#2]
Nope, not really. Hehehe. Do you mean, you want to be able to have area's on the entity you can see right through?

Well, it seems like your after alpha in your texture. Some tools do this for you.

Make your texture. Colour the bits you want to see through, a colour that's completely different from any other colour on the entity. like RGB(255,0,255). Then:

http://www.blitzbasic.com/codearcs/codearcs.php?code=1013


Try that function. Call the texture_mask_colour() function. Pass across the texture and the colour 255,0,255. This should put alpha information into the texture. You will need to use that function in your code because it doesn't save the image :o)


jfk EO-11110(Posted 2006) [#3]
Probably he was talking about turning off fustrum culling:

entityfx mesh,16


Sledge(Posted 2006) [#4]

Nope, not really.



Well you can do it by copying the render to an image buffer then drawing it back masked, but alpha textures are probably more sensible.


Buggy(Posted 2006) [#5]
Ross C was right on the money, and I'll try it out. By the way, what is fustrum culling?

Edit: I tried just loading in a texture as "Alpha Masked" and it works fine.

Edit #2: I can't make it so that this sphere is loaded to another camera, so that the background that can be seen through the sphere is the background from another camera. I tried putting a plane behind the sphere in the sphere's camera and making the alpha of the plane 0, but when I transfer this over to the main camera, there's still black space. Any thoughts?

IF THIS IS CONFUSING:

Basically, I want a sphere on a player's HUD. The sphere, however, has to have see-through portions (achieved through an alpha-mapped texture, which I can do successfully). My problem is that I can't figure out how to transfer the sphere from the HUD camera to the main camera without getting that black space from the HUD camera. I need the player to see through the sphere's see-through portions to see the main screen's background.

Any ideas are most welcome and appreciated.


Buggy(Posted 2006) [#6]
Does anyone know if anything like this is seen in either the archives or another game?


Sledge(Posted 2006) [#7]
CameraClsMode will let you build up one image from multiple cameras.




Buggy(Posted 2006) [#8]
I'm not exactly sure what this code does, but I think it's too complicated. I need to re-install Blitz3D on this computer, but I'll try it out later.

Here's a better explanation of what I want:

Imagine a basketball without the orange ball part, so just the rubber seams are shown. Now, camera #2 is filming this, along with the rest of the HUD stuff.

Meanwhile, camera #1 is capturing the main game, which is being portrayed on the screen.

I need the sphere to be shown on the main screen like any other HUD object, and I need it (and all other HUD objects) to be shown on top of the main game screen seamlessly (without the black boxes associated with multiple cameras).

(I can get the sphere the way I want it, so for now just worry about the HUD objects in general.)

How do other people do their HUDs?


AJirenius(Posted 2006) [#9]
Most people seem to use SpriteCandy actually.
I havent uet, but will probably buy it soon enough.


Buggy(Posted 2006) [#10]
Eet verks! Eet verks!

I'm not quite sure why it works, but it does. CameraClsMode works wonders.

P.S. Sorry for the same-topic posting on multiple threads. I just get anxious when I need answers.


Sledge(Posted 2006) [#11]

I'm not quite sure why it works, but it does. CameraClsMode works wonders.


The cameraclsmode() flags set in my example simply tell the hudCam not to clear the target buffer's contents before rendering. The cameras render in the order they are created, so calling Renderworld causes the mainCam to render the in-game scene then the hudCam to composite its render over the top.


Buggy(Posted 2006) [#12]
Oh. So I guess you were right, Sledge. And this whole time I had thought that I figured it out on my own! Oh, well.


Sledge(Posted 2006) [#13]
As long as you're up and running. :)