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 / Draw only part of an object.

Author
Message
Southside Games
16
Years of Service
User Offline
Joined: 1st Jan 2010
Location: Don\'t tell me what to do!
Posted: 22nd Aug 2013 04:14 Edited at: 22nd Aug 2013 04:16
Hey.

Is there a way in DBP to draw only part of an object that is intercepted by another?

I want to make a sonar like blast that emits from the player. and when it touches part of the level you see white on it. like the goggles in Splinter Cell Conviction.

or like the fruit in Mario Galaxy 2 that makes paths appear.



Thanks.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 22nd Aug 2013 13:50
Hmm, that's a tricky one.

Spontaneously, given you're intersecting only very simplistic objects (i.e. a sphere), you could implement a "clip sphere" in a pixel shader. Off the top of my head:



The usage (if the above even works) would be:



TheComet

Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 22nd Aug 2013 14:01
Other than messing with vertex data I would imagine the quickest way would be like TheComet said, using a shader.

"Get in the Van!" - Van B
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Aug 2013 15:32
@TheComet

I've fixed your shader so it compiles in Dark Shader - and speeded up the comparison in the pixel shader. Here's the new version (compiles but haven't checked its functionality):



Here's the effect of the speed improvement in the pixel shader (according to Dark Shader asm code):

1. using your code



2. revised code





Powered by Free Banners
Southside Games
16
Years of Service
User Offline
Joined: 1st Jan 2010
Location: Don\'t tell me what to do!
Posted: 24th Aug 2013 18:03 Edited at: 24th Aug 2013 18:06
wow. good job you two. I'll compile and check the shader out when I can.

edit:

@ Green Gandalf

is the Comets usage code usable, or did you replace that too?
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Aug 2013 21:49
Looks OK at first sight. Why not try it and then we can deal with the issues if any later?

The only thing that baffled me a bit in the shader is the use of



instead of



The latter should make it white (which is what you wanted I think) whereas the original makes that bit black and/or transparent or something else other than white.



Powered by Free Banners
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Aug 2013 01:46 Edited at: 25th Aug 2013 02:02
Nice use of dot! I'll definitely remember that trick from now on for distance comparisons.

Let me just quickly note that I don't have DarkShader, and I am running a dual-boot computer with Linux and Windows. Windows can't connect to the internet because of drivers, so I'm writing this from my Linux boot.

Anyway, I have RenderMonkey installed on Windows, and modified the code a little so it works. I cannot guarantee it works straight away in DarkShader because I can't test it, I did however make the necessary modifications for it to theoretically work.

Quote: "The latter should make it white (which is what you wanted I think) whereas the original makes that bit black and/or transparent or something else other than white."


Black was my intention, because the parts outside of the clip sphere need to be invisible. If you made it white, you'd just see a distinct line across the object where the texture suddenly transitions into white. I think your intention was to "fill" the object with a colour so the cut off parts reveal it? It turns out this was a little more involved, but I got a solution below.

I had to change it so the distance check is performed in world space and not in projection space. I also added a way to colour the cut off parts of the object.

Here's the shader (again, although I made the necessary modifications for it to work in DarkShader, I can't test it myself):



Here's how to use it:



The results (pretty gruesome, if I may say so):


To answer the question you put in comments:
Quote: "//edited by GG (changed brackets) - but did you want to avoid processing this pixel entirely?"


If you don't explicitly set the output pixel to 0, the GPU will output whatever was in the buffer last, which will appear as random noise on your screen. At least this is the case with OpenGL.

TheComet

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Aug 2013 02:29
Quote: "Black was my intention, because the parts outside of the clip sphere need to be invisible. If you made it white, you'd just see a distinct line across the object where the texture suddenly transitions into white. I think your intention was to "fill" the object with a colour so the cut off parts reveal it? It turns out this was a little more involved, but I got a solution below."


Not sure I understood that. What's the line you're referring to? Wasn't my suggestion the same as your revised code except using white instead of red? Red certainly isn't "invisible" in your screenshots.

Quote: "If you don't explicitly set the output pixel to 0, the GPU will output whatever was in the buffer last, which will appear as random noise on your screen. At least this is the case with OpenGL.
"


Yes, my comment was misplaced - but I don't think you'll get random noise if you clip it - you should get whatever was rendered before which could be the background objects. Perhaps I've misunderstood what you mean?

Quote: "I had to change it so the distance check is performed in world space and not in projection space."


Yes, I wondered about that.

I've just tested your revised shader and it compiles fine in Dark Shader but doesn't seem to do what I expected at all. I expected something similar to those screenshots of yours. Something weird has happened between the two versions. I'll try to look at it tomorrow.



Powered by Free Banners
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Aug 2013 02:40
Quote: "I've just tested your revised shader and it compiles fine in Dark Shader but doesn't seem to do what I expected at all. I expected something similar to those screenshots of yours. Something weird has happened between the two versions. I'll try to look at it tomorrow."


I'll answer all the rest of your post tomorrow, because my keyboard is about to give me a waffleface I'm so tired.

Make sure you're using it on a more complex object. The shader isn't going to work on a cube primitive, you should go for something like a sphere.

TheComet

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Aug 2013 14:34 Edited at: 25th Aug 2013 14:36
Quote: "Not sure I understood that. What's the line you're referring to? Wasn't my suggestion the same as your revised code except using white instead of red? Red certainly isn't "invisible" in your screenshots."


It's not enough to colour the parts of the object white which are outside of the clipping sphere, because you get what you see in image #1.

My initial intention was to make the object look like image #2, which can be achieved by making the pixel invisible (0.0, 0.0, 0.0, 0.0).

It's essential to deform the mesh in order to get the "cut off" effect Southside is going for, as seen in image #3.



Quote: "Yes, my comment was misplaced - but I don't think you'll get random noise if you clip it - you should get whatever was rendered before which could be the background objects. Perhaps I've misunderstood what you mean?"


On my end I get random pixels lighting up and glimmering. I'm not exactly sure how GPUs allocate their memory, but I assume each frame isn't always going to be located a the same address.

Quote: "I've just tested your revised shader and it compiles fine in Dark Shader but doesn't seem to do what I expected at all. I expected something similar to those screenshots of yours. Something weird has happened between the two versions. I'll try to look at it tomorrow."


I hope you get it to work. I really should get DarkShader installed, but I don't use DBP anymore, so it'd be useless most of the time.

TheComet

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Aug 2013 14:42 Edited at: 25th Aug 2013 14:43
This is what I see with a textured sphere. This seems to have very little to do with the original query - and the main object changes size when you adjust the clipping sphere which I'm sure isn't what you intended.

Looks nice though



Edit: Just seen your latest post (I forgot to refresh before posting ) - I'll study that now.



Powered by Free Banners
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Aug 2013 14:45
What happens if you move the position of the clipping sphere to the very bottom of your textured sphere? Or perhaps use one of those character models DarkShader provides instead?

In my eyes it is doing what is intended, but clipping a sphere with a clipping sphere might seem a little confusing.

TheComet

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Aug 2013 14:49
I don't see how your images relate to the original query - in fact the first of your three images looks closest to me. Also, don't you want the things inside the clipping sphere to be white?

Actually, I can't see what the original poster's uploaded image is supposed to be telling us. Any ideas? Perhaps the OP could let us know?



Powered by Free Banners
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Aug 2013 14:54
Quote: "but clipping a sphere with a clipping sphere might seem a little confusing"


Seems clear enough to me - and your shader deforms the object in some weird way instead. How does that relate to the OP? I think we need some guidance from the OP here - otherwise we are simply doing two different things with no idea which, if either, is correct.



Powered by Free Banners
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Aug 2013 15:06
I interpreted the image he posted as follows:



TheComet

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 25th Aug 2013 15:07
Quote: "I want to make a sonar like blast that emits from the player. and when it touches part of the level you see white on it. like the goggles in Splinter Cell Conviction.

or like the fruit in Mario Galaxy 2 that makes paths appear."


I've never played those games, so have no idea how the effect looks.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Aug 2013 15:18
Quote: "I've never played those games, so have no idea how the effect looks."


Likewise - I could ask my grandson when he comes to visit later this week. His input is likely to be more informative than the OP's going by recent form.

@TheComet Interesting interpretation - but where does the white come in? From original post:

Quote: "and when it touches part of the level you see white on it"




Powered by Free Banners
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Aug 2013 15:24 Edited at: 25th Aug 2013 15:38
Oh I'm sorry, I totally misinterpreted what his query was.



In that case, the first shader will do the job with this modification.

[EDIT] Updated shader


How to use it:



TheComet

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Aug 2013 15:38
I edited my last post, as the shader was incorrect.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Aug 2013 15:43
I think you've re-introduced one of the bugs from the original version - the use of projection space instead of world space. I'll see if I can fix it quickly.



Powered by Free Banners
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Aug 2013 15:44
Fixed.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Aug 2013 15:58 Edited at: 25th Aug 2013 15:59
A few fixes. I think it matches your video now (and matches my understanding of what he was trying to do).



Screenie:





Powered by Free Banners
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 25th Aug 2013 16:13 Edited at: 25th Aug 2013 16:13
So how did it look?

[edit] Never mind

Southside Games
16
Years of Service
User Offline
Joined: 1st Jan 2010
Location: Don\'t tell me what to do!
Posted: 25th Aug 2013 21:29
... well, you guys have had a hell of a time when I was gone.

no you were right the first time comet. though I guess I did ask for both..

here is a video of Mario galaxy using said idea.

I'll try them out now.

http://www.youtube.com/watch?feature=player_detailpage&v=ra6BeZ3thUc#t=1031
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 25th Aug 2013 21:46 Edited at: 25th Aug 2013 21:49
lol that guy talking over the whole video, so loud even at 1% volume. Not just him, loads of people making gaming videos talk so loud these days, as if we can't hear them enough with a 5.1 surround sound system......... anyway:

Where in the video is the effect, it is 24 minutes long? Give us a time.



TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Aug 2013 22:03 Edited at: 25th Aug 2013 22:05
Quote: "lol that guy talking over the whole video, so loud even at 1% volume. Not just him, loads of people making gaming videos talk so loud these days, as if we can't hear them enough with a 5.1 surround sound system"


And to top it off, it's annoying as hell.

The effect starts at 17:38. That looks like the most frustrating thing to ever do to a platformer game.

TheComet

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 25th Aug 2013 22:16 Edited at: 25th Aug 2013 22:22
Hmm, resembles raycasting, anything not in range is clipped. Anything near the edge is drawn in bright green.

So you are on track.

Now that picture actually makes sense , I was looking at the the thing like was a magic carpet or something, then with the arrow pointing at the edge of the carpet.... anyway, it is the room floor clipped.

Quote: "clip( Input.Color.A < 0.1f ? -1:1 );
Discards the current pixel if the specified value is less than zero.
clip(x)

http://msdn.microsoft.com/en-us/library/windows/desktop/bb204826%28v=vs.85%29.aspx"


Wouldn't that work? Although your transparent pixel idea is similar. Not sure if the performance difference is trivial or not; not 100% sure about anything to do shader functions to be honest; it is just the other day I started shader programming...

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Aug 2013 22:27 Edited at: 25th Aug 2013 22:27
@ Chris - The shader already works (see here). You can't discard the pixels or you'll see straight through the object, which is undesired.

TheComet

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 25th Aug 2013 22:45 Edited at: 25th Aug 2013 22:46
Quote: "You can't discard the pixels or you'll see straight through the object, which is undesired."


Hmm, I did not think that mattered, since we actually want to see through the hidden parts of the level? In the video, the clipped parts of it are seen through are they not? With the backdrop revealled?

Anyway good luck

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Aug 2013 22:56
No, I mean you see through the object and may see other polygons that you shouldn't. Image #2 here somewhat demonstrates the issue: http://i.imgur.com/6mey61e.png.

TheComet

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Aug 2013 23:00
Quote: "Hmm, I did not think that mattered, since we actually want to see through the hidden parts of the level?"


Yes, that was my understanding too. I really don't see why clip(x) (with a suitable x) isn't exactly what's needed. The reference to white in the original post appears to be a red herring ().

Yes. You must see something when you don't render the object. If not what is behind it then what exactly? I think TheComet has confused everybody - and Southside Games still hasn't told us what the white issue was about. Why not tell us what we need to know in a straightforward coherent and complete fashion? It ain't rocket science.



Powered by Free Banners
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Aug 2013 23:15
Quote: "Image #2 here somewhat demonstrates the issue"


I agree. Since the background is black that's what you see. What's your point exactly?



Powered by Free Banners
Southside Games
16
Years of Service
User Offline
Joined: 1st Jan 2010
Location: Don\'t tell me what to do!
Posted: 25th Aug 2013 23:28 Edited at: 25th Aug 2013 23:53
@ Chris Tate

oh sorry I though I did. I copied the URL with the "play at time" function on you tube. play at 17:51

@ comet.

wow man your effect is freaken amazing! Works great! I'm compiling a fast demo to show how it looks.

Thank you guys!

edit:

mmm. I seem to not be doing it right. I don't know how to describe it so I'll post a pic.

whats weird is when I tested it on the player model it looked like it did for you Comet. IS the shape I'm working with to simple?

The ghosted object is a copy of the one with the effect so that you know what the path looks like. the effect should be positioned at the player.

I already had an effect loaded in. so I gave the vectors and effect new numbers.

code to start up


In game code
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Aug 2013 23:33
Quote: "I agree. Since the background is black that's what you see. What's your point exactly?"


Using clip(x) in my mind has two issues.

#1 - In the case of the second image, the background is black and that's what you see, quite correct. But what happens if we're looking at more complex geometry? If you clip an object, you're essentially cutting a hole into it. There's no guarantee there's always going to be a black background behind the hole, what if you suddenly see the insides of your map appearing?

#2 - By clipping you cannot colour the clipped areas of the object, because you're discarding the pixel information for that.

I'll post an image of what I mean... Let me just reboot.

TheComet

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Aug 2013 23:33
Quote: "I'm compiling a fast demo to show how it looks"


Yes please. Hopefully that will answer my queries.



Powered by Free Banners
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Aug 2013 23:36 Edited at: 25th Aug 2013 23:39
Quote: "By clipping you cannot colour the clipped areas of the object, because you're discarding the pixel information for that."


No you're not. I use clipping a lot and have no issues with it. You're only discarding the current object's pixel not every object's pixel at that position.

Edit: Sorry - I was referring to your earlier use of rgba = (0,0,0,0) not the use of colour such as red in which case I agree.



Powered by Free Banners
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 25th Aug 2013 23:38 Edited at: 25th Aug 2013 23:40
Quote: "I copied the URL with the "play at time" function on you tube. play at 17:51"


You did. My connection screwed up and I restarted the video thinking it would help; only to not realize it starts at 17:51

The video helped because the last mario game I ever played was Super Mario World on the SNES. Not sure if you even know what ancient console I am talking about.. so I couldn't tell the difference between the original image and a flying carpet. Is that creature still called Yoshi? lol Wasn't he the green one? Oh deary me.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Aug 2013 23:40
We seem to be making a meal of this between us. At least TheComet seems to have delivered something useful.



Powered by Free Banners
Southside Games
16
Years of Service
User Offline
Joined: 1st Jan 2010
Location: Don\'t tell me what to do!
Posted: 25th Aug 2013 23:54
check out my last post for an update.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 26th Aug 2013 00:03
Looks really cool

Southside Games
16
Years of Service
User Offline
Joined: 1st Jan 2010
Location: Don\'t tell me what to do!
Posted: 26th Aug 2013 00:05
what my weird bug?
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 26th Aug 2013 00:08 Edited at: 26th Aug 2013 00:09
@ Southside

It appears you're using vector 1 instead of vector 3 at this line:



I think that should be the following:


The rest of the code looks fine.

@ Green Gandalf & Chris

I made this image, I hope it clears up what I mean:



TheComet

Southside Games
16
Years of Service
User Offline
Joined: 1st Jan 2010
Location: Don\'t tell me what to do!
Posted: 26th Aug 2013 00:17 Edited at: 26th Aug 2013 00:19
mmm... it looks better, but still not fixed.

here is a video. Note that when it looks like it's expanding or shrinking that's me changing the radius#
[youtube]
http://www.youtube.com/watch?v=4AUlJPUB20s&feature=youtu.be
[/youtube]

I got to go for now. I'll see you guys later
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 26th Aug 2013 00:49
Yep, that would be the problem with the limited amount of vertices. I'm trying to see if there's a way to not have to deform the mesh to achieve the same effect, i.e. do everything in the pixel shader.

TheComet

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 26th Aug 2013 01:00
@TheComet

Thanks for the explanation. It's perfectly clear what you mean now. Nice solution. Just need to iron out the details for Southside Games. I'll leave that to you since you're obviously on top of this one now.



Powered by Free Banners
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 26th Aug 2013 01:39 Edited at: 26th Aug 2013 02:08
TheComet, I understand your concept; but I am thinking about walls and floors; the stuff that makes up the level. They cannot be squished like that can they? To illustrate try squishing a cube or a wall and see what you come up with.

Quote: "#1 - In the case of the second image, the background is black and that's what you see, quite correct. But what happens if we're looking at more complex geometry? If you clip an object, you're essentially cutting a hole into it."


That's the point, the walls and floors are flat, look at them in the video, pause it. There is nothing behind them to see; its a platform game; there camera view is in the same direction. Like cardboard cut outs.

You're looking inward into a Pony, rather than outwards from within a game level.

edit: OK I see we are on the same wavelength now anyway. So back to the drawing board I guess. Leaving you to it.

Southside Games
16
Years of Service
User Offline
Joined: 1st Jan 2010
Location: Don\'t tell me what to do!
Posted: 26th Aug 2013 08:07 Edited at: 26th Aug 2013 08:34
Hey Comet. I used a plain with a lota vertexes and yes. it looked better. But I really don't want to make tiles with a high count.

My world is made using tiles like a sprite game. I added a picture to show you.

You did good work bro and I really appreciate what you have done. But for frame rates sake I can't use the shader as it is now.

I'll take a look at the one made to do the wave blast thing. All I really need is just a way to mark an invisible path. If it could have a texture that would be great, but a simple circle around the player to mark edges will do fine.

edit:

Yah man the blast effect will do. though is there a way to full the circle in?

Also line thickness seems to do nothing and seems to shrink as the radius increases.

Thanks though for all the hard work you guys have done. I really did not intend for you guys to go though this much work.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 26th Aug 2013 12:08
@ Chris - I see where you're coming from, and yeah, you can't squish a cube with the method I proposed.

I'm doing some things with multipassing to pseudo-generate geometry (because DX9 doesn't have geometry shaders), but it's not working out all too well.

Quote: "Hey Comet. I used a plain with a lota vertexes and yes. it looked better. But I really don't want to make tiles with a high count.

My world is made using tiles like a sprite game. I added a picture to show you.

You did good work bro and I really appreciate what you have done. But for frame rates sake I can't use the shader as it is now."


Completely understandable. It's a hard problem really, because you kind of have to generate vertices if you want a coloured edge.

Question: Do you need the coloured edge? Because that's what's causing all of these brain aches right now. If all you need is the model to be invisible past a certain point, then the first shader can do that (as in image #1 here).

Quote: "Yah man the blast effect will do. though is there a way to full the circle in?"


Fill it in with what? A separate texture? A colour?

Quote: "Also line thickness seems to do nothing and seems to shrink as the radius increases."


Make sure you spelled "clipSphereThickness" correctly in DBP.

I fixed the issue with the thickness shrinking when the radius increases, here's the updated shader:



Quote: "Thanks though for all the hard work you guys have done. I really did not intend for you guys to go though this much work."


It's what we're here for.

TheComet

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 26th Aug 2013 12:42
Quote: "Quote: "Also line thickness seems to do nothing and seems to shrink as the radius increases."

Make sure you spelled "clipSphereThickness" correctly in DBP."


Are you sure there isn't an error in the shader? In one version I looked at yesterday you'd forgotten to square the thickness (or something like that) which would make the line thinner as described.



Powered by Free Banners
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 26th Aug 2013 14:36 Edited at: 26th Aug 2013 14:37
Quote: "Are you sure there isn't an error in the shader? In one version I looked at yesterday you'd forgotten to square the thickness (or something like that) which would make the line thinner as described."


Yeah, I just noticed that as well (fixed it in my last post).

The reason why I say it might not be spelled right in DBP is because he claims it doesn't change anything in the shader, but looking at the shader code, it should.

Just waiting for OP to respond to my question:

Quote: "Question: Do you need the coloured edge? Because that's what's causing all of these brain aches right now. If all you need is the model to be invisible past a certain point, then the first shader can do that (as in image #1 here)."


TheComet

Login to post a reply

Server time is: 2026-07-06 20:16:50
Your offset time is: 2026-07-06 20:16:50