• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Medo Mex

Sparks Effect

37 posts in this topic

How do I create realistic sparks effect?

 

I used different textures but I couldn't get it to look like realistic sparks.

 

Can someone show me a simple texture for sparks? I'm not sure how the texture should look like (1 spark texture, few sparks texture, etc...)

 

I'm trying to accomplish something like this:

http://www.youtube.com/watch?v=237z9rh4wgs

0

Share this post


Link to post
Share on other sites

Well are you? Don't downvote me. I'm trying to help. Common...

Edited by Reflexus
-1

Share this post


Link to post
Share on other sites

If you look closely the sparks you can see that they aren't just camera facing quads (billboards), so you can't make the effect with just a texture. You'll need to use something like camera facing wide lines in order to give the sense of trail. 

 

Cheers!

0

Share this post


Link to post
Share on other sites

@belfegor: What I know is that Volumetric lines can be used for laser beam, what that has to do with the particles engine?

0

Share this post


Link to post
Share on other sites

@belfegor: What I know is that Volumetric lines can be used for laser beam, what that has to do with the particles engine?

 

 They're also useful for elongating particles to simulate motion blur of particles moving faster than the frame-rate can depict.

 

Edit: The posted video was rendered in Blender which can simulate motion blur during the render process. For a real-time application such as a game, however, such motion blur tricks as Blender uses might not be feasible. In that case, you can use elongation of the particles to fake it.

Edited by JTippetts
0

Share this post


Link to post
Share on other sites

The example is showing how to do it using effect file, how do I accomplish that without using effect file? I want a pure C++/D3D9 way.

0

Share this post


Link to post
Share on other sites

I really don't know if it is possible with FFP, but my guess is that it would be very difficult and limiting on what you could achieve against shader approach which is by far better, flexible and standard for many years from now.

Why are you avoiding to learn shaders? There is no reason not to use them and they are not that difficult once you grasp basic concept.

0

Share this post


Link to post
Share on other sites

The thing that frustrated me is that I can't use FFP light and that I'll be forced to create light using Shader.

 

Can you show me a simple texture that could be used for sparks? I'm not sure how the texture should look like.

Edited by Medo3337
0

Share this post


Link to post
Share on other sites

You may create the required geometry on the CPU and feed it to a vertex buffer. That way you don't have to use a shader. 

 

"The simple texture" method (if there is one) won't give you the effect you are looking for. 

 

Cheers!

0

Share this post


Link to post
Share on other sites

The thing that frustrated me is that I can't use FFP light and that I'll be forced to create light using Shader.

Sparks are emissive (they are lights) so they don't need to be lit.

Can you show me a simple texture that could be used for sparks? I'm not sure how the texture should look like.

I would render them as lines, as mentioned above, and colour them with a gradient from the front to the back of the line.

You could either do this with a 1D texture, or by simply using vertex colours:

[attachment=15721:spark.png]

What I know is that Volumetric lines can be used for laser beam, what that has to do with the particles engine?

There's many ways to draw particles.

Instead of drawing a quad where the particle currently is right now, you can draw a line between where it is now, where it was a moment ago, and where it was a moment before that. This gives you a curved line. If you colour that line with a gradient like above, and render it with additive blending, then you get the impression of a very fast moving bright object.

1

Share this post


Link to post
Share on other sites

Hello there. one of the older directx 9 sdks has what you want. its the pointSprite demo looks like thats would be a good start for you

they look nice. early 2007 DirectX SDK.

1

Share this post


Link to post
Share on other sites

When I use the following code to create volumateric lines, I see the lines are stuck on the camera all the time.

 

How do I position the lines at certain position in the 3D space?

FLOAT g_fSpinX = 0.f;
FLOAT g_fSpinY = 0.f;
FLOAT g_fTX = 0.f;
FLOAT g_fTY = 0.f;
FLOAT g_fTZ = 14.f;

D3DXMATRIX mWorld;
D3DXMATRIX mWorldProjection;
D3DXMATRIX mTranslation;
D3DXMATRIX mRotation;

D3DXMATRIX g_mProjection = camera->GetProjectionMatrix();

D3DXMatrixRotationYawPitchRoll( &mRotation, D3DXToRadian( g_fSpinX ),
D3DXToRadian( g_fSpinY ), 0.f );
D3DXMatrixTranslation( &mTranslation, g_fTX, g_fTY, g_fTZ );//0.f, 0.f, 14.f );
mWorld = mRotation * mTranslation;

mWorldProjection = mWorld * g_mProjection;

// We will not be using a viewing transformation, so the view matrix will be identity.
effect->SetMatrix( "mWV", &mWorld );
effect->SetMatrix( "mWVP", &mWorldProjection );

UINT passes = 0;
if( SUCCEEDED( effect->Begin( &passes, 0 ) ) )
{
effect->BeginPass( 0 );
device->SetFVF( TVertex::FVF );
for( UINT i=0; i < ARRAY_SIZE( g_aLines ) / 2; i++ )
RenderLine( g_aLines[i*2], g_aLines[i*2 + 1] );
effect->EndPass();
effect->End();
}
0

Share this post


Link to post
Share on other sites

Did you see something here?

// We will not be using a viewing transformation, so the view matrix will be identity.
effect->SetMatrix( "mWV", &mWorld );
effect->SetMatrix( "mWVP", &mWorldProjection );
0

Share this post


Link to post
Share on other sites

Yes, I tried to change it.

 

I tried setting mWorldProjection to the camera projection and mWorld to the transformation of the volumetric lines.

 

When I do that I don't see the lines anymore.

Edited by Medo3337
0

Share this post


Link to post
Share on other sites

I tried setting mWorldProjection to the camera projection and mWorld to the transformation of the volumetric lines.

 

worldProjection = world * projection. Got that right?

 

To be crabby... Those aren't even volumetric lines. They're just fancy linear billboards with UV selection based on orientation... in an outrageously terrible implementation at that! You probably could write up proper volumetric lines if you're competent, which I recommend. When you integrate over the path through an OBB, I don't think you'll want to base it on sqrt() distance, which would be pretty (INSANELY) naive considering performance, but won't provide a fully realistic distribution anyway. I'll reply again if I can think of a good way to do this. Others can throw in their suggestions too if they want. biggrin.png

 

EDIT:
This might be helpful. I'm reading it myself and I'll try to put it into useful terms (appropriate for your needs). smile.png

 

http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=5FFDAF33F6C101694D4F9987AFA25C3D?doi=10.1.1.96.5955&rep=rep1&type=pdf

 

 

One last additional remark

 

point sprites = billboards which are oriented about a point.

linear billboards = billboards which are oriented about a line.

Edited by Reflexus
0

Share this post


Link to post
Share on other sites

worldProjection = world * projection. Got that right?

 

When I do that, the lines are stuck on the camera all the time, they appear like sprites.

 

I believe this can accomplish what I need which is (sparks particles).

 

So, my only problem right now is setting the transformation, I have the problem that I mentioned earlier.

 

worldProjection = world * projection                  // --> Stuck on the camera all the time
worldProjection = camera->GetProjectionMatrix();      // --> I don't see the lines anymore
0

Share this post


Link to post
Share on other sites

I tried doing the following:

D3DXMATRIX mWorld;
D3DXMatrixIdentity(&mWorld);

mWorldProjection = camera->getProjectionMatrix();

effect->SetMatrix( "mWV", &mWorld );
effect->SetMatrix( "mWVP", &mWorldProjection );

When I do that I don't see the lines.

0

Share this post


Link to post
Share on other sites

When I do that I don't see the lines.

Where are their positions defined anyway? If you're just using identity then you should make sure they're in that small limited frustum which is tanget to the XY plane (i.e. screen space), and make sure your Z-clipping fits. lol, otherwise, actually use the right matrices. I'll try to explain below. This is the code you showed me:

 

D3DXMATRIX mWorld;
D3DXMatrixIdentity(&mWorld);

mWorldProjection = camera->getProjectionMatrix();

effect->SetMatrix( "mWV", &mWorld );
effect->SetMatrix( "mWVP", &mWorldProjection );

 

mWorld should be world * view, and mWorldProjection should be mWorld * your projection. What is the name of your matrix for viewspace? You don't seem to have any clue of what your own matrices are or what they do anyway. I think you need to go back and properly understand how transformation matrices are used to render 3D scenes.

 

Do you understand what a world matrix really is, and what a view matrix is?


WVP = world * view * projection. In simpleton terms, world refers to how individual content is transformed. View is how the virtual camera is positioned/oriented. Projection is how things are projected onto the screen plane. D3d9 abstracts these, but eventually it really just concatenates them into a single matrix and multiplies geometry by this to get it into its final position in camera space (pretty much screen space; the difference is somewhat trivial). So here, it asks for two matrices, WV and WVP. WV is world * view, and WVP is just WV * projection. Got it?

 

By the way, I may have thought of a good and fast way to do real volumetric lines, but I'll need to try it for myself before I start spewing nonsense.

Edited by Reflexus
1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0