• 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
Bastich-666

Weird Fog where there should be none?

7 posts in this topic

I hope someone can help with this as I've been looking for it for about a week now and its starting to drive me a bit potty :-( Its a very very strange problem. Basically I have a landscape which is made up from a number of large 1km x 1km tiles. The problem is that one tile (not a consistent tile, so not model related) fogs to black without me trying or wanting it to do this. The only fogging I am using is to blend the horizon to avoid any sharp edges and thats to grey not black. I have removed all fancy shading effects and it still does it? I've even removed the fogging code from my shader file. This still didn't help. As a final test I overwrote my blinn phong shader with a flat lit one which basically only does a texture lookup. Just to confirm that its being used I have rigged it to always have 100% red component. As expected all my geometry has a red tinge to it. However the problem still persists (red not black not of course).

So does anyone have any ideas how a shader with no fogging capabilities still manages it???

James
0

Share this post


Link to post
Share on other sites
Unfortunately I have ruled out the normal's as the problem changes tile. I can influence the problem by altering the order they are loaded into memory from the scene script or by increasing / decreasing the amount of memory I allocate to the PSSM system. By altering the PSSM memory usage via a script the same EXE with the same data files produces the same problem but in a different place?!?!?

I am still at a complete lose as of to how the above problem can even exists when running through a shader as simple as this:

[i]float4x4 worldViewProjectionMatrix;[/i]
[i]texture colorMapTexture;[/i]

[i]sampler2D colorMap = sampler_state
{
Texture = <colorMapTexture>;
MagFilter = Linear;
MinFilter = Anisotropic;
MipFilter = Linear;
MaxAnisotropy = 16;
};[/i]

[i]struct VS_INPUT
{
float3 position : POSITION;
float2 texCoord : TEXCOORD0;
};[/i]

[i]struct VS_OUTPUT
{
float4 position : POSITION;
float2 texCoord : TEXCOORD0;
};[/i]

[i]VS_OUTPUT VS_Full_Lit(VS_INPUT IN)
{
VS_OUTPUT OUT;[/i]
[i] OUT.position = mul(float4(IN.position, 1.0f), worldViewProjectionMatrix);
OUT.texCoord = IN.texCoord;[/i]
[i] return OUT;
}[/i]

[i]float4 PS_Full_Lit(VS_OUTPUT IN) : COLOR
{
float4 color = tex2D(colorMap, IN.texCoord);[/i]
[i] color[0]=1.0f;[/i]
[i] return color;
}[/i]

[i]technique Full_Lit
{[/i]
[i] pass[/i]
[i] {
VertexShader = compile vs_2_0 VS_Full_Lit();[/i]
[i] PixelShader = compile ps_2_0 PS_Full_Lit();
}
}[/i]

I can see another day of banging my head against a wall :-(
0

Share this post


Link to post
Share on other sites
Hi,

have you checked that your mipmap generation is correct?

You can easily test this by disabling mip mapping in the effect file. It may be that the mip maps contain just black color which will result fade to black when the 0 level texture is blended to the different mip maps.

Cheers!
0

Share this post


Link to post
Share on other sites
Hello, thanks for the mip map suggestion. Unfortunately it does not appear to be that ether. The textures at the minute are all 2048 x 2048 jpg files, I've not got round to DDSing them etc yet. I use the following code to load the textures:

D3DXCreateTextureFromFileEx( device, source, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &texture )

I've tried forcing 0 mip map layers but it makes no difference :-(
0

Share this post


Link to post
Share on other sites
[font=courier new,courier,monospace]MipLevels [in]
UINT
Number of mip levels requested. If this value is zero or D3DX_DEFAULT, a complete mipmap chain is created. If D3DX_FROM_FILE, the size will be taken exactly as it is in the file, and the call will fail if this violates device capabilities.[/font]

Note that the first surface of the texture is a mip level too.
0

Share this post


Link to post
Share on other sites
Thanks kauna for suggesting mip maps and thanks also to Nik02 for helping me realize that I had not actually disabled the auto generation of mip maps. As soon as I set it to D3DX_FROM_FILE it all started to work correctly. This explains the error perfectly :-)

The only slightly worrying thing is that it means that the auto generation is not reliable. I say this as I have been using this system for a long time and never ever seen this before. This has been a gigantic pain to find but its done now. Looks like I will be implementing my own mip map generator again. Time to resurrect part of my old dx7 system. The only other solution is to use DDS Converter to make all my textures / mip maps. Shame it doesn't seem to work on anything above XP.

Thanks again for all the help. I did think I was loosing the plot a few times.

Any recommendations on DDS texture generators???
0

Share this post


Link to post
Share on other sites
This may throw off your driver:

MinFilter = Anisotropic;
MipFilter = Linear;

Try to set the mip filter to anisotropic, and min filter to linear.
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