Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / using plane as decal problem with transparency

Author
Message
Chiblue
16
Years of Service
User Offline
Joined: 6th Nov 2009
Location: NE PA, USA
Posted: 31st Aug 2010 23:17
I am using a textured plane to represent a bullet open, I am creating the plane and texturing it, then instancing it when I need it...these are the attributes I am using..

Ghost Object On bullethole
Set Object Transparency bullethole,1
Set Object Ambient bullethole,true
Set Object Light bullethole,0
Set Object FOV bullethole,45

The hole appears perfectly, with one exception.. when I hit a wall and position the plane instance part of the center of the image
i.e.the bullet hole itself I can see straight through to the scene behind the wall/plane...

But the main part of the alpha blending i.e. the area around the hold I only see the wall as I would expect...

Any ideas on why this would be happening?
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 31st Aug 2010 23:48
What's the problem exactly? Wouldn't you expect to see through the hole? Perhaps you need to clarify what you mean - and give us a screenshot of how it looks.
Chiblue
16
Years of Service
User Offline
Joined: 6th Nov 2009
Location: NE PA, USA
Posted: 1st Sep 2010 03:17
Sorry, see attached image... you will notice that the bullet holes you can see the terrain behind i.e. blue sky, grass, road etc...

this is a screen show...
Chiblue
16
Years of Service
User Offline
Joined: 6th Nov 2009
Location: NE PA, USA
Posted: 1st Sep 2010 03:18
sorry could not get the uploader to work...

Here is the bullethole image I am using...
Rich Dersheimer
AGK Developer
17
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 1st Sep 2010 04:13
If you are shooting holes in a wall, then it makes sense to see through.

But... if you are shooting holes in a cube, then all you would see through the bullet holes is the inside of the cube. Check if your cube has normals on both the inside and inside. I think it's the SET OBJECT CULL command that will give your objects interior surfaces.

Chiblue
16
Years of Service
User Offline
Joined: 6th Nov 2009
Location: NE PA, USA
Posted: 1st Sep 2010 04:24
but I don't want a hole, but the image on the surface... so it looks like a the bullet has hit and damaged but not penetrated...
Visigoth
21
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 1st Sep 2010 04:40
too much black in your bullet hole image maybe? Or, when you set object transparency, try the different modes. 6 works best for me.
The transparent colour is determined by the SET IMAGE COLORKEY command or the alpha channel of the texture. The transparency modes are used to control when and how the object is drawn into the scene, and are described below. Special consideration should be used with the depth sort system, which takes the coordinate of the object and camera and depth sorts based on the distance between these points. You can inadvertantly create a situation where a large object behind a small object would have a shorter distance, and be rendered last instead of first.

0 - draw first no alpha
1 - draw first with alpha masking
2 and 3 - draw second which overlaps solid geometry
4 - draw second alpha test (only render beyond 0x000000CF alpha values)
5 - water line object (seperates depth sort automatically)
6 - combination of 3 and 4 (second phase render with alpha blend AND alpha test, used for fading LOD leaves)
Chiblue
16
Years of Service
User Offline
Joined: 6th Nov 2009
Location: NE PA, USA
Posted: 1st Sep 2010 04:49 Edited at: 1st Sep 2010 04:51
thanks, I tried all transparency settings but still see through it...

But if I use transparency 4 without ghost object... seems to work..
Visigoth
21
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 1st Sep 2010 04:58
Instanced or Cloned plains?
You may have to use Clone Object, then apply all the transparency and ghosting.

Unlike CLONE OBJECT, this instance will share most of the original objects data and be dependent on the original object remaining in existence to hold such data. Instanced objects do have the ability to hide/show both their limbs and hide/show the object, independent of the original object. This command is ideally suited to copying large numbers of primarily static objects such as trees and rocks where the original model data is to remaing largely unchanged.
Visigoth
21
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 1st Sep 2010 05:03
you know, I just had a thought. Could it be possible to make a "stack" of decals as one object, each decal a limb, and then just hide them? As you need one, just position the limb and show it?
One object way better than many, I've found.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 1st Sep 2010 19:43
Take your bullet hole image back into your paint program and the parts that you want transparent make them transparent in the alpha channel.

OR

Change the color of the middle of your bullet hole to something other than rgb(0,0,0), like maybe rgb(16,16,16) and it will show.

In almost everything I've done with transparency, SET OBJECT TRANSPARENCY, 3 or 5 always worked the best. However, each situation is different so you'll have to experiment with that.

Softwizz
17
Years of Service
User Offline
Joined: 14th May 2009
Location: U.K.
Posted: 4th Sep 2010 18:05
I agree with KISTech, make the actual bullet hole grey or something instead of black.

The way it works now is great for shooting at thin objects like wooden doors or sheets of thin metal (corrugated iron sheets) but if you are shooting a stone block then use a slightly different coloured decal.

Login to post a reply

Server time is: 2026-07-24 23:12:03
Your offset time is: 2026-07-24 23:12:03