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

Lighting showoffs!

9 posts in this topic

OK, I just thought I'd show off the lighting abilities in my game now that I've transferred all drawing over to shaders. The lighting can handle Normal mapping, shadow mapping, ambient, emissive, diffuse and specular lighting. I've just got one screenshot which shows those things in action:

 

[url=http://s302.photobucket.com/user/george7378/media/LEM3D19_zpsd6b30f3a.jpg.html]LEM3D19_zpsd6b30f3a.jpg[/URL]

[url=http://s302.photobucket.com/user/george7378/media/LEM3D17_zpsa64b3aa3.jpg.html]LEM3D17_zpsa64b3aa3.jpg[/URL]

 

Thanks for looking!

0

Share this post


Link to post
Share on other sites

Not bed as lighting goes. You could use some bloom!! The textures need some work but otherwise this is a very good start!

1

Share this post


Link to post
Share on other sites

Hey - thanks! I know that the terrain textures need some work - and yes, I'd love to add some bloom! I guess that's doable with HLSL too?

0

Share this post


Link to post
Share on other sites

Hi. HLSL and cgFX are fully capable of producing a bloom post-processing effect; You only have to check if the hardware you're using is fast enough for this, and if it supports framebuffers.

 

There's an old fixed function trick you can use to improve the detail on the ground (to alleviate that texture stretching visual): using a "detail texture".

 

It's simply a seamless "noise" texture that you apply to the entire terrain with an index above that lunar surface texture you have there now.

This detail texture needs to wrap so it can tile across the entire terrain and not be stretched. It also needs to have a multiply blend mode so it multiplies that lunar surface texture you have right now. Give it a test, you'll see it looks more convincing.

Edited by Kryzon
1

Share this post


Link to post
Share on other sites

Light bloom would be cool, but it also seems to be a lot of addition for what might not be necessary right now - I'll add it to my list of things to do when I fix some more prominent issues first! I really like the idea of the detail texture - I guess I could do it in HLSL rather than fixed function by sampling a second texture and multiplying the colour by that sampled value? I'll give it a try! I did try to use different textures with different tiling, etc... but it never looked right. Maybe this time it will!

0

Share this post


Link to post
Share on other sites

OK, so I tried multiplying the base texture by a more detailed sand-like texture, and it looks better close up, but in the distance, I can see lots of evidence of tiling - I made sure to create a seamless image and I wrap it in the texture sampler. Here's what I'm talking about:

 

[attachment=15535:detiltex1.jpg]

 

...and here's what I'm doing in the shader:

 

     float4 baseColour = tex2D(TextureSampler, PSIn.TexCoords);

     float4 detailColour = tex2D(DetailTextureSampler, PSIn.TexCoords*10.5);

     baseColour *= detailColour * 2;    

     Output.Colour = baseColour*(diffuseLightingFactor + xAmbient);

 

I suppose there's something I'm missing!

0

Share this post


Link to post
Share on other sites

OK, I applied a slightly better texture (an old sand texture converted to greyscale) and I'm beginning to see large improvements:

 

[attachment=15536:LEM 3D 21.jpg]

 

This one doesn't look too bad from a distance either! I'm thinking that it would be a good idea to only apply the detail texture to pixels which are a certain distance from the camera - does anyone know how to find the depth of a pixel in HLSL? I know how to do it by rendering to a shadow map and then sampling from that, but is there a simple way without needing to do this?

 

Thanks!

1

Share this post


Link to post
Share on other sites

This technique is really making an improvement! It already looks a lot more realistic, after just an hour of messing around!

 

[attachment=15537:LEM 3D 22.jpg]

 

I think this will be great when I properly smooth it out! Thanks!

2

Share this post


Link to post
Share on other sites

Those last two screenshots look amazing man, great job.

 

 

I'm thinking that it would be a good idea to only apply the detail texture to pixels which are a certain distance from the camera - does anyone know how to find the depth of a pixel in HLSL?

Is there a way you can sample the mipmaps? because they function just like that: different textures sampled based different levels of distance.

If in your app you manually create the mipmaps (instead of letting the API do that, say, with AutoGenMipmaps), then you can manually set different levels of transparency for each mipmap level texture, leaving the last level entirely transparent.

This way the more distant the ground point is, the smoother it'll be.

 

EDIT: This is what Super Mario Sunshine used to control the water specular effect, with manually created mip levels.

Edited by Kryzon
1

Share this post


Link to post
Share on other sites

Thankyou :) I am amazed at the difference! It makes it look so much more professional. And to think I once didn't like the idea of shaders...

 

I did find a crude way of only drawing the texture to pixels of certain depth. I add this to my VS output structure:

 

float  Depth : TEXCOORD4;

 

..Then in the VS itself:

 

Output.Depth = Output.Position.z;

 

...and finally in the PS:

 

float4 baseColour = tex2D(TextureSampler, PSIn.TexCoords);
if (PSIn.Depth < 40.0f){
float4 detailColour = tex2D(DetailLinearSampler, PSIn.TexCoords*20.5);
baseColour *= detailColour * 2;}

 

It draws the detail texture for pixels within a certain distance of my camera, and since this 'sand' texture is quite subtle, it's not possible to see the boundary between the detail texture and the main texture. It works for now!

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