Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Burnt_Fyr

Member Since 25 Aug 2009
Offline Last Active Jul 27 2015 12:10 PM

#5237485 Basic Terrain editor help

Posted by Burnt_Fyr on 29 June 2015 - 08:10 AM

I handle this all through shaders, but it was a bit of work to get setup. I'm not sure the performance implications this may have( testing and experience would dictate) but when you lock a buffer you are able to move bytes into and out of it. I would try keeping a local copy of the vertex data, and lock/fill the vb each time you adjust the mesh.

 

As for the adjusting, you have the triangle index, and with it you can find the exact vertices that this triangle is made up of. simply change the height component of those 3 vertices, lock and fill, and render as normal.

 

In my terrain editor in progress, http://www.gamedev.net/blog/900/entry-2259765-slow-days/, I use a height map for elevation data. When using the raise/lower tool, if the mouse is down while updating, i pick the terrain to get an x,z pair at the intersection, use those to get uv coordinates, and use the UV coords to render a small brush to the height map, which raises or lowers the heights in the area that the brush intersects.




#5237482 Understanding D3D11 basics

Posted by Burnt_Fyr on 29 June 2015 - 07:17 AM

What you pass through has to match what the shader expects to receive.

If the shader expects 2x Vector4 values per vertex (1 for position and 1 for color), then you need to supply that.

 

Different shaders can expect different things, for example a single vector position, and the color hard coded in the shader.

struct VS_IN
{
	float4 pos : POSITION;
	float4 col : COLOR;
};

Your vertex shader is expecting 8 floats(2x float4) per vertex, as mentioned above, and this is where that information was dictated. if you do not follow the signature of the shader bad ju ju will follow. In dx9 this meansgarbage in garbage out. In dx10 and later, they got smart by forcing a validation with an input signature when compiling a shader. This is your layout parameter above as well. the shader signature, input layout, and vertex data must match if the shader has any hope of doing something with that data other than mangling it.




#5237478 Lineup of Books For Beginner

Posted by Burnt_Fyr on 29 June 2015 - 07:05 AM

I don't think I've had the pleasure of reading Real Time Rendering, but am a big fan of Frank luna's introduction to directx...(what ever is the latest) they seem to get better with each iteration, as one would hope.

 

In my opinion, Crister's book, RTCD, should be read after Game coding complete. I have the 2nd edition of Mike's book, and it seemed to hit a lot of things at an introductory level. RTCD on the other hand, I would say is more technical, and it's a can of worms that you may not want to eat just yet.

 

Jason's book is probably one of the best bang for your buck books with a price tag in that range, but works best if you've been exposed to the concepts ahead of time, perhaps in an earlier project from GCC.




#5233582 Engine design, global interfaces

Posted by Burnt_Fyr on 08 June 2015 - 12:34 PM

This all falls in line with my existing outlook, but I'm a little surprised to hear the static class method derided as "Another pointless abstraction."  I've read L. Spiro's blog post about her engine design, and that's the method she seems to have gone with.  Her reasoning seems sound, although a lot of it could be emulated by just using global functions in a namespace.

Perhaps L.Spiro should put an "about me" on HIS webpage, as it is not the first time I've seen this mistake.

 

http://l-spiro.deviantart.com/art/Japanese-Model-WIP-1-82010882




#5212807 How do I know if I'm an intermediateprogramming level?

Posted by Burnt_Fyr on 24 February 2015 - 06:02 PM

I'm not sure there is a line in the sand anywhere, but IMHO if you are asking, then you are likely not. I do not see any mention of templates, or the std::lib, which are quite within the range of what I would consider "intermediate" programming in c++. I've been working with c++ for a long time(longer than i care to even admit sometimes) and pascal and basic before that, and I still consider myself quite a "beginner" in regards to programming as a whole. My advice, don't give it a second thought, go out and write more code.




#5205575 c++ Heap corruption w/ std::vector

Posted by Burnt_Fyr on 20 January 2015 - 11:31 AM

BitMaster hit the nail on the head. A typo from my fat fingers:

pUVs[16] = Vector2(  0,  0 ); // Top Quad
pUVs[17] = Vector2(  0,  1 );
pUVs[18] = Vector2(  1,  0 );
pUVs[29] = Vector2(  1,  1 ); // whoops

Thanks all for the suggestions, Bregma, you pointing out that the existing code was fine, led me back to the previous 2 replies. This was in a debug build so i did have access to debugging features but as this was a new situation for me i was not sure what to look for.

 

 

HEAP: Free Heap block f6d48 modified at f6d58 after it was freed

The error visual studio 2010 gave me pointed to the location in the heap, but different runs always pointed to different locations. Is there a way i could have found out what line of code allocated what chunk of memory after the fact? Or would i have had to watch each allocation in turn and then use the address given to figure out the offending code? I'm still quite unfamiliar with a lot of the debugging functionality in visual studio




#5205563 c++ Heap corruption w/ std::vector

Posted by Burnt_Fyr on 20 January 2015 - 10:07 AM

Thanks for taking the time to read this. I'm using a mesh object that contains std::vectors for vertex and index data.

class Mesh2
{
// snipped for brevity
    std::vector<unsigned short>        indices;

}

void Mesh2::AddFace(unsigned short _i1,unsigned short _i2, unsigned short _i3) {
    
    indices.push_back(_i1);
    indices.push_back(_i2);
    indices.push_back(_i3);

}

The above functions reside in a static lib that contains all rendering code, linked to the main executable. Below are functions in the .Exe.

// In main()

Mesh2 cube;
GenerateCube(&cube,true,true);

and the function GenerateCube

GenerateCube(Mesh2* mesh, bool bGenNorms, bool bGenTangents)

{
 // at some point
 mesh->AddFace(0,1,2);

//.. and so on
}

The issue is as soon as mesh.indices has to resize past 10(it's default size) I get a heap corruption. I'm not sure what must be done to rectify this. If anyone has a good link or can spare 5 minutes for a thorough explanation it would be much appreciated. Everything I've pulled up on google so far has to do with crossing DLL boundaries which I'm not doing, but might be happening behind the scenes in the std::vector. I'm heading back to google for now.




#5204761 Vertex Declaration failure

Posted by Burnt_Fyr on 16 January 2015 - 01:22 PM

I'm by no means confident in my answer, but am going to hazard a guess, since the usage of PositionT  disables vertex processing, that it is not designed to work with multiple streams. Have you verified that the multiple streams are available? Are the usages you requested available on your card? Have you been able to multiple streams with  untransformed positions successfully?




#5178432 Signed angle between two normals?

Posted by Burnt_Fyr on 05 September 2014 - 08:34 PM

 


Buckeye: 3D vectors don't have signs

 

You're absolutely correct. Don't know what I thinking.

 

Thank god, because i was just seriously doubting my understanding of the cross product.




#5171439 Camera Creation Question

Posted by Burnt_Fyr on 04 August 2014 - 11:12 AM

RE your update:

 

you usually need a temp vector, such as one of the primary axiis to do this. so say you are x+ right, y+ up, z+ forward. take your lookatpoint and subtract position. cross(world.up, forward)with WORLD up(not local) to get right, then cross(forward, right) to get a true up vector.

 

as you already discovered, Mview = Mcamera-1




#5161137 3d rotation speeds

Posted by Burnt_Fyr on 17 June 2014 - 12:57 PM

But this yields problem of order of composited quaternion rotations. But I gess this is the responsibility of expressing last added quaternion corectly, rather than physical dilema.

 

 

And this is what gives so many permutations of Euler or Tait-Bryan angles.




#5159255 Shadow Volumes - Edge finding

Posted by Burnt_Fyr on 09 June 2014 - 07:55 AM

Read through the comment block in the first pass, and then the second. He is gathering directed edges where the i1 comes before i2. This is a shortcut for the second pass, notice the differences between the 2 loops.




#5159160 Clarification on SAT?

Posted by Burnt_Fyr on 08 June 2014 - 05:12 PM

Thanks for the response  Aardvajk,

 

Sorry I was not clear before, I meant to ask which axes would I project my shapes edge on the X  and Y axes or on an arbitrary axes that is made up by myself.

I think Aardvajk covered that pretty well. For 2 objects in 2D, you will need to project against each face normal of each object, with the exception of normals that are colinear with another normal. For a Triangle, you would have 3 axii, each perpendicular to one of the triangle's edges. For a square, you have 2 axii, the local X and Y, as the other 2 normals are -x and -y, which are collinear with their respective inverses.




#5158217 Still fairly new to 3D design...problem with my doom-style editor

Posted by Burnt_Fyr on 04 June 2014 - 03:07 PM

First sentence answered my question (at least with the ceilings)

 

Thanks so much.  It worked.  ^^

It's always a guess as to how detailed an answer to give, glad i could help.




#5158122 GetTerrain position help

Posted by Burnt_Fyr on 04 June 2014 - 09:39 AM

If you already have x and z, and get height gives you the y coordinate, what else do you need? or am I misunderstanding your intent?






PARTNERS