Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


Veil

Member Since 29 Apr 2012
Offline Last Active Aug 10 2012 02:21 PM

Posts I've Made

In Topic: What can cause visual studio to be unable to compile a Directx11 project?

07 June 2012 - 08:13 AM

Don't assume that VS is broken and needs patching - it's most likely your code and/or project settings. Why are you running it under a command shell? You'll need to post some code so that people can see what you're doing and comment further.


I'm using Frank Luna's directx11 sample: http://www.d3dcoder.net/d3d11.html

Pretty much all of them give me this error,I'm trying to compile the GeometryShader example right now in Part1.

In Topic: Creating Terrain

02 June 2012 - 07:55 AM

Well how close or far the mountains are depends on how you've drawn your heightmap.You shouldn't use pure white as primary color at the Clouds filter(I assume you made the heightmap in photoshop),as white means maximum height,which will make them look pointy.Try applying some grey here and there with a soft brush.Also it's a good idea to split the terrain into chunks and render only the ones that are actually going to be close to the camera and for the farther ones use a low poly version and some fog/blur to make the transition smoother,otherwise you're rendering millions of vertices just for the terrain.For the texture to look realistic in 3DSMAX click the model,open modifiers and select UVW Map,then make it Planar and give it a scale 5-6 times smaller than the actual size of the model,so it would tile 5-6 times along the surface.You would need a seamless texture for that,tho.

Edit:I've attached a heightmap that you might want to try:


Attached File  heightmap.bmp   1MB   67 downloads


In Topic: How do you manipulate individual pixels in a texture in Direct3D on the CPU?

31 May 2012 - 09:51 PM

The client really should be the one generating this stuff, sending actual assets over the network isn't the best use of bandwidth (of course, maybe you have something different in mind, but from what you said it sounds like an overly complicated method to do things)


The thing is,the terrain must be persistent and stay on the server and during the game players can affect and change it from time to time,but it's not really a problem - each zone has a tileset and each tileset has 8 different terrain types,so that's 0-7(3 bits for the tile type) and same for the tileset - 8 tileset types.

The point is I have to get the client to turn this received info into a blendmap pixel by pixel when receiving the terrain chunk data.

In Topic: How do you manipulate individual pixels in a texture in Direct3D on the CPU?

31 May 2012 - 09:25 PM

Since this hasn't been asked yet, I'll go ahead and bite the bullet: What Are You Doing, Really? Any time the subject of CPU readbacks come up, there's like a 90% chance a better way to do what you're trying to accomplish exists.


Well,I have a server program that sends to the client a data struct with info for the current terrain piece.The info is generated randomly by the server and sent to the client,so I want the client to draw a terrain blendmap with the info from the received struct and then use the blendmap in the shader.This only happens when the client receives a new terrain piece(the player walks into a new zone)or when he burns the ground or something.Still it's not every frame,so I suppose it shouldn't cause a noticeable slowdown?

In Topic: How do you manipulate individual pixels in a texture in Direct3D on the CPU?

31 May 2012 - 03:43 PM

You need to call Map() on the texture to get access to the texture data. Don't forget to call Unmap() afterwards. You will have had to create the texture with the proper flags to be able to write to the texture.

ID3D10Texture2D


wait will this work on directx 9?

edit:IDirect3DTexture9 has LockRect() method,but I'm not sure exactly how to use it,could someone explain it's arguments:

[in]   UINT Level,
  [out]  D3DLOCKED_RECT *pLockedRect,
  [in]   const RECT *pRect,
  [in]   DWORD Flags

PARTNERS