Fog shader for 3ds max

May 12th, 2011

3 Comments

After some silent months, I decided to pack up and release some of my 3ds max scripts and plugins. This is the first of the upcoming series of scripts. With this plugin, you can get a cool shading effect on your models to be able to see dents in smooth surfaces better. This is done by this fog shader. I’ve seen this functionality in a modelling tutorial in (I think) XSI softimage. This was actually stunned by this way of visualizing the model while modelling. It’s quite a clever way of seeing what’s going on from back to front. It’s hard to explain this without some kind of picture, so here’s a screenshot of the shader in use.

Read more...

Comments

January 13th, 2011

2 Comments

After about 4 months of radio-silence, I decided to update my blog regularly again. I’ve added the option to add comments to the posts, which should make the blog way more interactive, since you can ask me questions or post suggestions now. I’ll be writing some posts very soon.

Read more...

Tutorial 23 HLSL Shadow Mapping

September 16th, 2010

2 Comments

In the last tutorial of this series, I will try to explain how to create your own shadow mapping shaders. We’ve already seen the shadows of truevision3d, now it’s time to create our own system. This is by no means the best type of shadowing, it is just good to get an understanding of what is actually happening. The system we’ll make is for a point light. The basic idea behind it is to place 6 camera’s on the place of the light, each facing outwards, so you’ve got a complete view from the camera. This is a cubemap. We’ll render the depth of the object the camera sees to the cubemaps’ faces. This then allows us to do a lookup in the direction of the pixel we’re rendering, to see if the distance of the cubemap is lower than the real distance. If it is, we have a shadow.

Read more...

Tutorial 22 HLSL Heat Haze

September 16th, 2010

No Comments

Everyone knows this phenomena, you can see it about the tarmac or even something as simple as a candle. A heat haze. What is happening in nature? The air above something that is hot is rising. There are pressure differences and that means the breaking index of the air is difference, in other words; the light rays bend a little. This effect is really cool to have in our scene as well, so we’ll do that. We will take the post-effect approach. What will we do? We will render the scene without the heat haze to a texture, then we’ll render the heat haze (being particles) on to another texture. Then we’ll combine it in a shader to draw it to the screen.

Read more...

Tutorial 21 HLSL Per pixel object

September 15th, 2010

No Comments

We’ve seen an object shader already, but now we’re going to do something more interesting. In tutorial 4 (per pixel lighting), we’ve seen some per pixel lighting already. It would be good to try and replicate or even improve this effect. We are going to do this in this tutorial. Before you continue, make sure you at least have an idea of what tangent space and parallax mapping might be.

Read more...

Tutorial 20 HLSL Basic post

September 15th, 2010

No Comments

Everyone will have seen black and white films/pictures, sepia pictures, pictures or movies with film grain etc. To get such an effect in the 3D world, we normally use a technique called post-effects. This means we apply some kind of filter after (post) rendering. This means we don’t have to do the effect on every object that’s hidden, we only apply the filter on the pixels that are actually visible. This can be really usefull and good, especially when adding some more calculation heavy stuff.

Read more...

Tutorial 19 HLSL Basic object

September 15th, 2010

No Comments

Now for the more advanced TV3D tutorials. The next 6 tutorials will be about shader and how to work with them. I’m not going to explain all about shaders, there are a lot of good resources for that already. Take a look at this wiki page: wiki. In this first tutorial we’re going to create a simple shader that will just output the cube with a texture. This can be the template for any object shader you’re going to write.

Read more...

Tutorial 18 Shadow volumes

September 14th, 2010

No Comments

There is a light phenomena that we haven’t discussed yet. It is seen everywhere around you. Shadows. You might think we’ve already covered this, since a cube doesn’t get light when it’s not facing the light, but that’s not what we’re going to do right now. What if a light shines on that cube and there’s something below the cube? That would cast a shadow. In Truevision3D, it is not too hard to add shadows. It’s actually quite easy. It doesn’t suit all purposes and doesn’t always look like the most high end shadow solution, but it’s decent and well worth looking at.

Read more...

Tutorial 17 Billboard particles

September 12th, 2010

No Comments

How cool would it be to be able to render smoke? Or fire? Everyone will need some kind of particle system eventually. In this case we will make some nice smoke. You might ask yourself what a particle system is. If you wonder about that, take a look at this wiki page. In this case, we are using a billboard particle system. A billboard is like a camera oriented plane. It will always face the camera. This makes it easier to create the textures to place on it. The particle system will spawn some billboards, apply textures on them and move them around based on some rules you can set, like gravity.

Read more...

Tutorial 16 Simple input

September 12th, 2010

No Comments

We already know a lot about the engine, we know how to load geometry, render it, create some 2D graphics. There is however a very important thing we didn’t do yet. What is a game without input? It’s not really a game right? Well, that’s why this tutorial is there. We’ll make sure we can rotate the camera around a cube, so we can view other areas of the scene we’re in.

Read more...