• 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
Meltac

Non-volumetric smoke effect in pixel shader

7 posts in this topic

Hello again

I'm looking for a simple way to create a half-decent smoke effect purely in a pixel shader, some kind of 2D post-process fake effect. Nothing volumetric or particle-based, but something that can be implemented in HLSL only within a single pass pixel shader.

I know that this is perfectly possible because I have seen it on the web a while ago but unfortunately didn't find the source again.

Could anybody provide either some working example code or link(s) to website(s) elaborating an approach for such an effect?

Thanks in advance.
0

Share this post


Link to post
Share on other sites
I'm not too familiar with these techniques, but if you do not want to use volumetric or particle based techniques, would a billboard work?
If you have a texture atlas for each frames of the smoke effect, you could loop it on a billboard.

By billboard, I mean a textured quad that always faces the camera. It won't look as good as the other techniques (and it's probably as expensive), but it will be achievable in a single pass.
0

Share this post


Link to post
Share on other sites
I'm pretty sure I have seen volumetric fog/smoke done in a single pass shader. But if that's not your thing.... billboarding's a possibility, but it looks the same from all angles. I'd suggest a 3D-aware technique that doesn't get too crazy, e.g. no raycasting etc. I have seen techniques (I forget the terminology) which interpolate between x billboards depending upon angle.

This link gives an approach of creating clouds with a feeling of volume using a collection of billboards and a light absorption model:
[url="http://rafaeltorchelsen.files.wordpress.com/2010/10/sbgames_2005_simulacao_em_tempo-real_de_nuvens_utilizando_billboards.pdf"]http://rafaeltorchelsen.files.wordpress.com/2010/10/sbgames_2005_simulacao_em_tempo-real_de_nuvens_utilizando_billboards.pdf[/url]

The frame-rates sound low, but are for hundreds of clouds.
0

Share this post


Link to post
Share on other sites
Thanks guys. Unfortunately billboarding is not an option in my case because I don't have access to any additional textures from that particular shader. Nor is any 3D / voluminous technique, because I need to do this in a pure 2D pixel shader.

Let me explain what I'm after. I'm rendering sun shafts as a post process onto the final picture in the shader that is responsible for the post processing part. The sun shafts are purely 2D, I'm using this GPU Gems approach (Part 13.4 The Post-Process Pixel Shader): [url="http://http.developer.nvidia.com/GPUGems3/gpugems3_ch13.html"]http://http.develope...gems3_ch13.html[/url]

Now inside of buildings I wanna add some animated smoke/fog/dust effect to the sun shafts, like the well-known effect of dispersed dust particles being lit by the shafts' light. I've got everything ready to do it except the computation for generating that smoke/dust effect. I've tried some plasma computation that I found instead but it doesn't look good. Edited by Meltac
0

Share this post


Link to post
Share on other sites
[quote name='Meltac' timestamp='1343717113' post='4964739']I don't have access to any additional textures from that particular shader[/quote]That's going to make it very hard/computationally-expensive then... Usually you want to get an artist to paint some smoke/dust textures in advance, or run an expensive volumetric simulation in advance and render it to textures.

If you can't use a smoke texture, then you've got to try and procedurally generate one in your pixel shader, using random numbers and/or [url="http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter26.html"]noise functions[/url]... However, most RNG/noise functions are too expensive to implement in a pixel shader without loading some pre-computed values out of a texture!
0

Share this post


Link to post
Share on other sites
Actually I was thinking of some noise-function-thing (Perlin or whatever) already when opening this topic. As it seems I didn't make myself clear enough. I was hoping somebody could point me to a more or less ready-to-use sample, instead of just repeatedly telling me what I already know - that you "normally" would do this by some volumetric or particle-wise approach and that it won't be easy without.

But thanks anyway for trying to help.
0

Share this post


Link to post
Share on other sites
[quote name='Meltac' timestamp='1343740039' post='4964846']
instead of just repeatedly telling me what I already know - that you "normally" would do this by some volumetric or particle-wise approach and that it won't be easy without
[/quote]I wasn't saying that it will be hard without volumetrics or particles -- but that it will be hard without [b]textures[/b][b].[/b]
Where does this restriction come from? Are you modding an existing game or something?
0

Share this post


Link to post
Share on other sites
[quote name='Hodgman' timestamp='1343740754' post='4964848']
Where does this restriction come from? Are you modding an existing game or something?
[/quote]

Yes, exactly. S.T.A.L.K.E.R. Shadow of Chernobyl, built on X-Ray 1.0 Engine. Awesome game, but very cumbersome engine. I have only access to some specific vertex and pixel shaders, but not all. I can't make new shaders or change the setup (e.g. texture assignment) of the existing ones, nor can I do any DirectX API function call (D3D...), only pure HLSL with the existing assigned textures etc. Edited by Meltac
0

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