|
|
#1 |
![]() Join Date: Feb 2010
Reputation: 9
Posts: 151
|
Droplets on screen
Hello!
I want to do the following: When the player enters a func_precipitation, the screen should be covered with slowly trickly drops. The problem is not checking whether the player is inside or outside a func_precipitation (that's done in the code already), my problem is: how to create such a "rainy screen" (like in GTA IV when driving a boat or NFSU2 - click for example)? Does anybody have an animated texture in stock or an idea how to create something like this? Thanks in advance. |
|
|
|
|
|
#2 |
![]() Join Date: Aug 2011
Reputation: 60
Posts: 1,126
|
those are lil screenspace billboards with a refract shader. the texture could be a simple sphere normal map or you do some different shape to make it look better. if you want to you could rotate the billboards based on the center then check how fast you're moving forward and scale them to the outside based on that speed. should look awesome. maybe you even want to add a lowres noise texture over it animating and blending based on that speed. lots of possibilities.
|
|
|
|
|
|
#3 |
![]() Join Date: Feb 2010
Reputation: 9
Posts: 151
|
Thanks for your input, but I have no idea where tostart and what to do :\
Last edited by aVoX: 02-24-2012 at 11:10 AM. |
|
|
|
|
|
#4 |
![]() Join Date: Aug 2011
Reputation: 60
Posts: 1,126
|
so "that's done in the code already" means you using the regular client? or you coding yourself?
if you coding yourself. create a entity for that effect, find the meshbuilder and how to use it to generate geometry on the fly and attach materials to it, setup parameters to control it and render that as viewmodel. if you not coding you have to model the billboards and create an animation that does that effect. then attach it to the player so it gets rendered infront of the "player camera" (his eyes). also have to setup some logic to switch it off and on and basicly to control it. not much more i could say here. |
|
|
|
|
|
#5 | ||
![]() Join Date: Jun 2008
Reputation: 351
Posts: 1,804
|
Quote:
Quote:
|
||
|
|
|
|
|
#6 | ||
![]() Join Date: Aug 2011
Reputation: 60
Posts: 1,126
|
Quote:
Quote:
|
||
|
|
|
|
|
#7 | ||
![]() Join Date: Jun 2008
Reputation: 351
Posts: 1,804
|
Quote:
The meshbuilder is more inefficient in many ways especially when you would make it dependent from an entity. Quote:
I don't know of any good way to attach it either without code, but if you can attach a model then you can attach particles too, especially when the particles are compiled into the model. |
||
|
|
|
|
|
#8 |
![]() Join Date: Aug 2011
Reputation: 60
Posts: 1,126
|
yeah okay. the drawpolygon() is basicly the same as a DrawPrimitiveUP() in native d3d. that would do. but where to setup a topology. does it split that pile of quads? if not and in case you have say 256 droplets on screen you loop thru droplets and have 256x the call overhead of the function. doing with meshbuilder is doing a batch of droplets in one vertexbuffer and one funtion call.
2nd: particles do collision. even tho you can limit it. that's what i thought.
|
|
|
|
|
|
#9 | |
![]() Join Date: Jun 2008
Reputation: 351
Posts: 1,804
|
Quote:
And again, doing it the way you said would require all sorts of unnecessary calculations (and networking) related to the viewmodel thing. And that means that it would cost more? You can just disable it? Your alternative was a skeleton based animation, it's way slower than particles. |
|
|
|
|
|
|
#10 |
![]() Join Date: Feb 2010
Reputation: 9
Posts: 151
|
Don't mind me talking between, but thanks for all the hints and tips to both of you. Right now I am epically failing to create some drops in the particle editor... hopefully there will be a result asap.
However, thanks
|
|
|
|
|
|
#11 |
![]() Join Date: Aug 2011
Reputation: 60
Posts: 1,126
|
meh. what you need networking for a client screenspace or viewmodel effect. orthogonal projection, a custom material with a good shader and a dynamic vertex buffer. and spit the stuff on screen. ahh foo complicated interfaces to search for thousands of functions. i actually hate it. native is easier.
and skeletal animation. nah. look at the citadel destruction. fake that kinda generic and looping animation and done. no particle calc just some vertex stream frames and a shader to blend the positions. |
|
|
|
|
|
#12 | |||
![]() Join Date: Jun 2008
Reputation: 351
Posts: 1,804
|
Quote:
.If that works out well I guess doing it that way would be a good option (if you don't want to/can't code anything). Quote:
Also, if you do it with a projection, then your argument about prefering the builder due to batching capabilities and better perfo makes even less sense. Just place stuff with unit cube coords in the client and save some calculations on the cpu & gpu. But an entirely dynamic mesh with a load of vertices that is set up each single frame is just relatively slow, especially if you need to recalculate the actual vertex data. Quote:
Particles are much more flexible too and it's easier to change them. |
|||
|
|
|
|
|
#13 |
![]() Join Date: Aug 2011
Reputation: 60
Posts: 1,126
|
well. if you say so. maybe you don't picture the same effect that i do.
![]() so... go for your particle approach. i'm fine with it. |
|
|
|
|
|
#14 | |
![]() Join Date: Feb 2010
Reputation: 9
Posts: 151
|
Quote:
|
|
|
|
|
|
|
#15 | |
![]() Join Date: Jun 2008
Reputation: 351
Posts: 1,804
|
Quote:
Furthermore, are you actually intending to do this in a singleplayer mod to begin with? If not, all of the hacky ideas are pretty much useless anyway and it should be coded. |
|
|
|
|
![]() |
|
||||||
| Thread Tools | |
| Display Modes | |
|
|