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 / Normal map transparency issue

Author
Message
Satchmo
21
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 23rd Jul 2010 23:31
So, I'm using evolved's sm 2.0 shader for normal mapping with lighting functions included, and it seems that any object using the set object transparency command is unable to pick up more than one light. Any help is appreciated.

-Satchmo

Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 24th Jul 2010 04:44
Don't use set object transparency on it. I don't think it will work with transparency..... What are you trying to do that would require you to try that?

The fastest code is the code never written.
Satchmo
21
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 24th Jul 2010 19:03
Bullet decals and characters with some transparency. Is there no solution?

Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 24th Jul 2010 19:06
Never tried it.

The fastest code is the code never written.
Satchmo
21
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 24th Jul 2010 20:53
Anyone else?

Rain Man
18
Years of Service
User Offline
Joined: 19th Nov 2007
Location:
Posted: 25th Jul 2010 08:01
Applying a shader to an object negates or overrides a lot of effects. I'd try adding the transparency to the shader and let the shader handle it.

Ten minutes to Wapner.
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 25th Jul 2010 17:37
One option is to replace the planes you texture with the bullet hole with cutouts of the bullet hole shape so you don't need transparency.

If it hasn't exploded yet, I haven't touched it.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 25th Jul 2010 18:37
Another, very expensive way, is to have each wall with it's own texture. Each time a bullet hits the wall, determine where on the texture it hits and put a hole in it using memblocks. The holes would be in the "brick" and if you do it to the bump as well, you will see a definite indention. Once the "hole" is made, it won't take up any more ticks when rendering. If you've never used memblocks for this type of stuff, don't worry, they are fast. The expense will be in the duplication of the textures.

Another method is to make a small plane and duplicate it about 100 time or more and texture it with the "bullet hole" with transparency. Each time a "bullet hole" is made, determine the normal of the wall face and location of the "hole" and place one there. You have to keep track of which "bullet hole" is the oldest or have it cycle to the first one when you go past 100.

There MUST be a better and faster way than what I suggested, but I don't know it. If you come accross it, post it here please.

The fastest code is the code never written.
Caleb7
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location:
Posted: 26th Jul 2010 00:18
Rain Man is right you had best add transparency to your shader.
I have been playing with transparency in my normal shader for awhile now with partial success. One method I tried that works for the most part is discarding the pixel who's alpha channel is to low. For example:

Clipping is very efficient because when a pixel is clipped, I'm pretty sure it doesn't go through the following calculations.

I don't have too much shader experience so I'm not sure how to effectively "ghost" certain pixels. I did some researching on the internet and found that when you put this

within the 'pass' of each light, right after the compile command, it permits alpha shading. It turns out funny on my shader, every non cliped island of pixels has a cartoony outline.

Randomnosity is a special influence upon man kind allowing one to think outside the usual bouderies and into a fantastic world created by oneself. Elephants don't cut it

Login to post a reply

Server time is: 2026-07-25 05:32:49
Your offset time is: 2026-07-25 05:32:49