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!


ryan20fun

Member Since 06 Oct 2010
Offline Last Active Yesterday, 12:42 AM

#5219681 Logo Feedback

Posted by ryan20fun on 27 March 2015 - 12:59 PM

I thought it was some kind of circle with eyes and a six in the middle.

 

Could you make the outline of it more clear?, Just something to show the arms and legs a bit more so that it is more easily to see it for an anteater.

 

HTH

Ryan.




#5206580 Supporting Multiple DirectX Versions

Posted by ryan20fun on 25 January 2015 - 12:31 PM


 

For vertex buffers, D3D9 uses IDirect3DVertexBuffer9 while D3D11 uses ID3D11Buffer

 

What is the correct way to create a struct that handle both so I can use it in IRenderer?

 

Here is what I have right now:

struct EngineVertexBuffer
{
      ID3D11Buffer *D3D9_VB;
      IDirect3DVertexBuffer9 *D3D11_VB;
};

 

I would use two different implementations, But if you want to have one implementation to hold both versions for some reason then I would use a union and some type of global variable denotating which one to use.

 

So it would be:

class VertexBuffer : public GraphicsResource
{
  public:
     void*           GetObject() const;
     SomeVariable    GetVersion() const;

  private:
     union
     {
          ID3D11Buffer*             VB11;
          IDirect3DVertexBuffer9*   VB9;
     } u;
     SomeVariable     m_DirectXVersion;
}

HTH

Ryan.




#5206512 Supporting Multiple DirectX Versions

Posted by ryan20fun on 25 January 2015 - 12:34 AM

 

@cozzie: That's already what I have, now I'm not sure what the correct parameters that I should put here so I can support multiple version of DX:

IRenderer::createVertexBuffer(...);
IRenderer::createIndexBuffer(...);
IRenderer::draw(...);

I would say that you should start by doing a low level abstraction of the one you want your interface to emulate.

 

Right now I have a "ResourceCreator" class that you can get after you load the library(DLL), This in tern is used to create any type of resource that is supported.

 

An example of my index buffer's create method(I do need to make alowance for 2byte indices):

/*! This creates the vertex buffer with the specified number of elements and in the specified memory pool.
*
*	Parameters:
*		Elements	: The number of elements of length of sizeof( pIndices[ 0 ] ).
*		pIndices	: A pointer to the index data to use for creation.
*		Topology	: How the elements will be use to create the rendering surface.
*		Usage		: The usage pattern to apply to this resource.
*		CPUAccess	: What access should the CPU have to this resource.
*/
DLLEXPORT virtual HRESULT Create( const unsigned Elements, const unsigned* pIndices,
								  const PrimitiveTopology Topology = PrimitiveTopology::TriangleList,
								  const UsageType Usage = UsageType::Immutable,
								  const CPUAccess CPUAccess = CPUAccess::None ) = NOT_IMPLEMENTED;


And the vertex buffer:

/*! This creates the vertex buffer with the specified number of elements.
*
*	Parameters:
*		Elements	: The number of elements of length of Description.length().
*		Description	: The layout of each element in memory.
*		pVertices	: A pointer to the vertex data to use for creation.
*		Usage		: The usage pattern to apply to this resource.
*		CPUAccess	: What access should the CPU have to this resource.
*/
DLLEXPORT virtual HRESULT Create( const unsigned Elements, const Vertex::Layout Description,
								  const void* pVertices, UsageType Usage = UsageType::Immutable,
								  const CPUAccess CPUAccess = CPUAccess::None ) = NOT_IMPLEMENTED;

HTH

Ryan.




#5196642 Files

Posted by ryan20fun on 06 December 2014 - 11:16 AM

1. If I write  DATA1 that contains 4bytes for example and I want to return later and write exactly after that DATA1 i set the FilePointer to the sizeof(DATA1 ) of the sizeof(DATA1 ) + 1?

That seams right to me, But you could use some dummy data and a hex editor.

I use HxD to check my binary files.

 

2. WriteFile(  ... (char*)users[0] , sizeof(int)*users_number ) will start to write from element 0 to the last element of the vector because of the sizeof that tells where to stop or because the & operator? What about if I want only to write a single element to the file (like in the last line of the code) it will be ok (char*)sizes[0] or (char*)&sizes[0] with smaller size to write specified in the WriteFile argument ?

That would treat the value of users[0] as the char pointer.

And it would write as many bytes as you tell it to, Which you set correctly.

 

 

 

Some nitpicks:

 

I would advise you use C++ cast operators( static_cast, dynamic_cast, reinterpret_cast ) instead of C syle as they are searchable and I find them more readable.

 

Why does the "WriteFile" function have so many parameters?, Could you not just do the same as std::fstream( pointer, byte count ) ?
 

HTH

-Ryan.




#5194371 What heap wil dynamic memory be created on

Posted by ryan20fun on 24 November 2014 - 03:12 AM

Hello all.

 

I am busy working on makeing a vertual file system, And I've run into a problem that I may have been cruising around because all my DLL libraries are using the same platform toolset( And that means the same heap right? ).

That problem is: Who is responsible for deallocating the memory: Caller or Callee ?

 

So if I create a structure like so:

struct Blob
{
          unsigned char* pData;// std::vector< unsigned char > Data
          size_t Length;
};

(Would the vector dealoccate itself from the right heap?)

 

As far as I know if the structure was allocated on heap A and the caller is using Heap B and deallocates it there will be a crash or segfault or something, Right?

 

So the bottom line is: How do I make sure that the memory is deallocated from the right heap.

 

 

Am I correct in my understanding of dynamic memory here?

 

Many thanks

Ryan.




#5185951 Tutorial Series

Posted by ryan20fun on 09 October 2014 - 04:21 AM

Are you going to upload to YouTube like the "WoA II" journals ?

Because I generally don't watch videos online, I download them first and then go over them as needed smile.png




#5183419 3D Model Loading Problems

Posted by ryan20fun on 27 September 2014 - 11:28 PM

 

 

 

It is typical to see corrupted geometry when programming object importers / exporters. Winding order is the simplest of the problems to solve. Typically invalid output is result of triangles indexing wrong vertices.
 
Cheers!

I know that. But how could a professional 3d software give wrong indices or vertices? 
By the way, vs2012 model view failed to load the obj exported by max. But it worked well with blender's.
The 3D CAD tool 99 times out of 100 produces valid file(albit with there own tweak on some formats like DAE, wavefront object )
The problem most likely exists in your parser code, It is also posible that the CAD tool has produced a edge case with the file.
 
I would recomend that you use a tool like Assimp to do the heavy lifting for you and you just process the data from it.
It's what i do, And it saves me from the hassle of different 3D formats as it handles a nice variety of them.
 
Hope that helps smile.png
i don't know much about assimp.but i think i will have to go there some day. Is there any tutorial about assimp with d3d? If not , gl is fine

 

This ought to get you started.

If you need more help just ask, Or if you want I could post the code I am currently using(but that will change after some time next month due to grabage output when using multiple objects but I am sure that has to do with how I am handling the vertices though... )




#5132964 Bone Importing Basics

Posted by ryan20fun on 20 February 2014 - 08:27 AM

What do you mean by the "intersection point"? Remember, each "bones" is really a matrix, or a set of scale-rotation-translation data.

He probably means the point where the child/parent bone connect, Much like an armature from blender or max.




#5123488 ConLangs (Constructed Languages, Language Creation)

Posted by ryan20fun on 13 January 2014 - 11:53 PM

So how is it going ?

 

Can you give any tips ?, As i've looked at The language Construction Kit and don't understand a lot of it, Proberbly need to google the terms a bit more :(

And have you looked at other conlangs ?

 

I'm interested in the use of conlang's for alien species, As it would be nice to not have all species speaking english( like in mass effect ), But will probably with some type of "universal translater" for the player like in star trek )

 

Good luck with your conlang!




#4855830 C++ int beyond 2,147,483,647?

Posted by ryan20fun on 31 August 2011 - 05:49 AM


btw, is "log long" supposed to be "long long"? thought we were gonna use logarithms hehe.

Yes, it was most likely just a typo on his part; it's supposed to be "long long".


Yes, it was supposed to be long long.
will correct it now.


#4855788 C++ int beyond 2,147,483,647?

Posted by ryan20fun on 31 August 2011 - 01:57 AM

Hi, out of curiousity, is it possible for a C++ integer (or long integer according to what i read) to go beyond 2,147,483,647?

How do i attain it? do i need a certain library or piece of code to make it possible?

Cheers.

yes "long long" / "__int64" although the latter is compiler/OS/vendor specifiec as far as i know
they go from –9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
and uses 8 bytes.
big enough for you ?
check out this


#4851686 Sprites and D3D9

Posted by ryan20fun on 20 August 2011 - 12:45 PM

1. I've noticed that the texture is scaling to the closest 64x64, 128x128, 256x256, 512x512, 1024x1024 etc. If my texture is 300 in height, it's going to be scaled to 512 in height. Can I disable this somehow?


it depends, does the card support non power of two textures ?
if so you can manually specify the x and y size, its what i do.

2. What do you think is better? Using Sprites or setting up vertices?


i would vote sprites for now, i think if you are going to upgrade to D3D10 / 11, it might be easier to use vertices and rotate them manually etc.
because from D3D10, Microsoft dropped the fixed function pipeline.

@ryan20fun: Ok, I've checked the Debug Runtime Version. Should I do anything with the Debug Output Level?


the more debug out put D3D will Do.
if you select the highest out put, you will get mesages for everything you did wtong, and forgot to do.

Where will I find this debug help in Visual Studio when I work?


D3D will output the info to the "Output" Window, the one that tells you X has been compiled.


#4851599 Sprites and D3D9

Posted by ryan20fun on 20 August 2011 - 08:15 AM

What header do I have to include to use TDWORD and wstring? Also, I've checked for null values with if statements but didin't find any.

Regarding the Debug Runtimes. This is the window, but now I don't know what to change? Your path worked untill this window :P
Posted Image



@Aerodactyl55: I'm calling it?

Graphics::Graphics(HWND hWnd)
{
	d3d = Direct3DCreate9(D3D_SDK_VERSION);

	ZeroMemory(&d3dpp, sizeof(D3DPRESENT_PARAMETERS));

	d3dpp.Windowed   = true;
	d3dpp.SwapEffect  = D3DSWAPEFFECT_DISCARD;
	d3dpp.hDeviceWindow  = hWnd;
	d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
	d3dpp.BackBufferWidth = 1280;
	d3dpp.BackBufferHeight = 800;

	D3DXCreateSprite(d3ddev, &sprite);

	HRESULT hr = d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3ddev);
}


Thank you btoh for helping me appreciated :)


you need to select the "Use The Debug Version Of Direct3D 9"


#4851361 Sprites and D3D9

Posted by ryan20fun on 19 August 2011 - 02:11 PM

it would be quicker to set a break point and copy the value of the HRESULT and look it up in the DirectX Error Lookup tool / google.



Sorry, but, how do I set a break point? And how can I copy the value of the HRESULT? Sorry, but I've never done this before, first time I even hear about it :/



to set a break point( in VS ) click in the light brown line on the left of the code page, or there should be a add break point here button
when the break point hits, hold the mouse over the hresult and a little box should pop up, select the text in there and copy it.


#4846846 Ambient occlusion simulation for AAA projects

Posted by ryan20fun on 09 August 2011 - 01:44 PM

hardcoded into Crytek engine.


and what makes you think that it is hardcoded ?




PARTNERS