amadeus12

Members
  • Content count

    9
  • Joined

  • Last visited

Community Reputation

108 Neutral

About amadeus12

  • Rank
    Newbie

Personal Information

  • Interests
    Programming
  1. I'm studying loading bones and animations data in fbx file by assimp library. I'm looking into assimp tutorial which is based on openGL while I'm doing this with dx11. In that tutorial, I have to understand his system which is not easy for me. I just wanted to extracts the information not how to use it. so what I need is... 1.Bone ids and weights per vertex 2. Bone data which is Toroot matrix, offsetmatrix,index of it and hierarchy information like who's your daddy. 3. animation data which is time , Scale,Rotation,Tranform vectors I saw assimp documentation. It says mTransformation The transformation relative to the node's parent. this mean that matrix is toparent matrix?(if that node is root's son then it's gonna be toroot matrix and if it is the rootnode then it's identity matrix right?) mTranformation inverse matrix is offsetmarix right?(tochild matrix) the transformation relative to the world is world matrix right? does 'relative to' means going that space . I mean local to world matrix is the transformation relative to the world I'm having problem with understanding english help me plz and little bit of tip for extracting data from fbx by assimp thank you for reading terrible english
  2. I'm building my own tool, it's 'jobless.0.3' I'm parsed objects and write it in my style and save it. the model file it self is no problem. I think the mode is problem. I saw uv coordinates is more than 1. what kind of sampler state I should use? this is my format below vertex { p:0.000000,0.100000,4.500000 n:0.000000,1.000000,-0.000000 t:1.000000,0.000000,0.000000 u:0.000000,0.937500; p:24.000000,0.100000,4.500000 n:0.000000,1.000000,-0.000000 t:1.000000,0.000000,0.000000 u:2.000000,0.937500; p:0.000000,0.100000,2.890000 n:0.000000,1.000000,-0.000000 t:1.000000,0.000000,0.000000 u:0.000000,1.138750; p:24.000000,0.100000,2.890000 n:0.000000,1.000000,-0.000000 t:1.000000,0.000000,0.000000 u:2.000000,1.138750; p:0.000000,0.000000,-2.880000 n:-0.000000,0.099504,0.995037 t:1.000000,0.000000,0.000000 u:-0.000023,1.859195; p:24.000000,0.000000,-2.880000 n:-0.000000,0.099504,0.995037 t:1.000000,0.000000,0.000000 u:1.999977,1.859195; p:0.000000,0.100000,-2.890000 n:-0.000000,0.099504,0.995037 t:1.000000,0.000000,0.000000 u:-0.000023,1.871758; p:24.000000,0.100000,-2.890000 n:-0.000000,0.099504,0.995037 t:1.000000,0.000000,0.000000 u:1.999977,1.871758; p:24.000000,0.000000,2.880000 n:-0.000000,0.099504,-0.995037 t:1.000000,0.000000,-0.000000 u:2.000005,1.140554; p:0.000000,0.000000,2.880000 n:-0.000000,0.099504,-0.995037 t:1.000000,0.000000,-0.000000 u:0.000006,1.140554; p:24.000000,0.100000,2.890000 n:-0.000000,0.099504,-0.995037 t:1.000000,0.000000,-0.000000 u:2.000005,1.127992; p:0.000000,0.100000,2.890000 n:-0.000000,0.099504,-0.995037 t:1.000000,0.000000,-0.000000 u:0.000006,1.127992; p:24.000000,0.100000,-4.500000 n:0.000000,1.000000,-0.000000 t:1.000000,0.000000,0.000000 u:2.000000,2.062500; p:0.000000,0.100000,-4.500000 n:0.000000,1.000000,-0.000000 t:1.000000,0.000000,0.000000 u:0.000000,2.062500; p:24.000000,0.100000,-2.890000 n:0.000000,1.000000,-0.000000 t:1.000000,0.000000,0.000000 u:2.000000,1.861250; p:0.000000,0.100000,-2.890000 n:0.000000,1.000000,-0.000000 t:1.000000,0.000000,0.000000 u:0.000000,1.861250; p:24.000000,0.000000,-2.880000 n:0.000000,1.000000,-0.000000 t:1.000000,0.000000,0.000000 u:2.000000,1.860000; p:0.000000,0.000000,-2.880000 n:0.000000,1.000000,-0.000000 t:1.000000,0.000000,0.000000 u:0.000000,1.860000; p:24.000000,0.000000,2.880000 n:0.000000,1.000000,-0.000000 t:1.000000,0.000000,0.000000 u:2.000000,1.140000; p:0.000000,0.000000,2.880000 n:0.000000,1.000000,-0.000000 t:1.000000,0.000000,0.000000 u:0.000000,1.140000; } indice { 0 1 2 2 1 3 4 5 6 6 5 7 8 9 10 10 9 11 12 13 14 14 13 15 16 17 18 18 17 19 } texture { diffuse :Road05.jpeg normal :Road05_NORM.png } effect :normal bufferkey :road look it's 2.0000000 and 1.86 it's more than 1. and I using default samplerstate which is wrap mode. I think this is the problem then what adrress mode should I use? this is picture other model fine. it's parsed same parser that i made. road image only.
  3. There're tons of weird files in there. I tried cmakefile gui version it occurs error and I tried older version and it return 1 mesh number that means it doesn't work. there's no tutorial and sample code that doesn't work. I currently use VS2017 and I want to make 2017 dll file. actually I want it to work on VS2017.. please help me!
  4. I wanna know how to deal with occlusion map roughness map metallic maps... I mean , about calculating texel in HLSL code. I can't search topics.. Is there no way to search topics?
  5. I made my obj parser and It also calculate tagent space for normalmap. it seems calculation is wrong.. any good suggestion for this? I can't upload my pics so I link my question. https://gamedev.stackexchange.com/questions/147199/how-to-debug-calculating-tangent-space and I uploaded my code here ObjLoader.cpp ObjLoader.h
  6. this code is from introduction to DX11 by Frank D Luna. I kind of understand the theory of this. first get frustum coordinates in view space. get model's world matrix and view matrix. get inverse matrix to find out frustum's coordinates in model's local. my question is, why do I only need X component of scale matrix? what if the object got stretched by z,y axis? for(UINT i = 0; i < mInstancedData.size(); ++i) { XMMATRIX W = XMLoadFloat4x4(&mInstancedData.World); XMMATRIX invWorld = XMMatrixInverse(&XMMatrixDeterminant(W), W); // View space to the object's local space. XMMATRIX toLocal = XMMatrixMultiply(invView, invWorld); // Decompose the matrix into its individual parts. XMVECTOR scale; XMVECTOR rotQuat; XMVECTOR translation; XMMatrixDecompose(&scale, &rotQuat, &translation, toLocal); // Transform the camera frustum from view space to the object's local space. XNA::Frustum localspaceFrustum; //TransformFrustum(&localspaceFrustum, &mCamFrustum, XMVectorGetX(scale), rotQuat, translation); XNA::TransformFrustum(&localspaceFrustum, &mCamFrustum, XMVectorGetX(scale), rotQuat, translation); // Perform the box/frustum intersection test in local space. if(XNA::IntersectAxisAlignedBoxFrustum(&mSkullBox, &localspaceFrustum) != 0) { // Write the instance data to dynamic VB of the visible objects. dataView[mVisibleObjectCount++] = mInstancedData; } } md3dImmediateContext->Unmap(mInstancedBuffer, 0); }
  7. I wrote computeshader to blur image. But it returns black texture. actually I'm not using FX file and effect library. I use hlsl file and I bind it to pipeline myself with direct api. I have 2 hlsl files which do vertical, horizontal blur. here my CPU code which executes computeshader. void BoxApp::callComputeShaderandBlur(ID3D11DeviceContext * dc, ID3D11ShaderResourceView * inputSRV, ID3D11UnorderedAccessView * inputUAV, int blurcount) { for (int i = 0; i < blurcount; i++) { dc->CSSetShader(m_CSH, 0, 0); dc->CSSetShaderResources(0, 1, &inputSRV); dc->CSSetUnorderedAccessViews(0, 1, &mBlurOutPutTexUAV, 0); UINT numGroupsX = (UINT)ceilf(m_Width / 256.0f); dc->Dispatch(numGroupsX, m_Height, 1); dc->CSSetShaderResources(1, 0, 0); dc->CSSetUnorderedAccessViews(1, 0, 0, 0); dc->CSSetShader(m_CSV, 0, 0); dc->CSSetShaderResources(0, 1, &mBlurOutPutTexSRV); dc->CSSetUnorderedAccessViews(0, 1, &inputUAV, 0); UINT numGroupY = (UINT)ceilf(m_Height / 256.0f); dc->Dispatch(m_Width, numGroupY, 1); dc->CSSetShaderResources(1, 0, 0); dc->CSSetUnorderedAccessViews(1, 0, 0, 0); } dc->CSSetShaderResources(1, 0, 0); dc->CSSetUnorderedAccessViews(1, 0, 0, 0); dc->CSSetShader(0, 0, 0); } If I don't call this function, everything is fine. (I rendered my scene to off screen redertarget and use this texture as quad texture. and render it to real rendertarget. it worked fined) That means there's problem in ComputeShader code. Every resource and view isn't null pointer, I checked it. all HRESULTs are S_OK. here my 2 shader codes this is CSH.hlsl static float gWeights[11] = { 0.05f, 0.05f, 0.1f, 0.1f, 0.1f, 0.2f, 0.1f, 0.1f, 0.1f, 0.05f, 0.05f, }; static const int gBlurRadius = 5; Texture2D gInput; RWTexture2D<float4> gOutput; #define N 256 #define CacheSize (N + 2*gBlurRadius) groupshared float4 gCache[CacheSize]; [numthreads(N, 1, 1)] void main(int3 groupThreadID : SV_GroupThreadID, int3 dispatchThreadID : SV_DispatchThreadID) { // // Fill local thread storage to reduce bandwidth. To blur // N pixels, we will need to load N + 2*BlurRadius pixels // due to the blur radius. // // This thread group runs N threads. To get the extra 2*BlurRadius pixels, // have 2*BlurRadius threads sample an extra pixel. if (groupThreadID.x < gBlurRadius) { // Clamp out of bound samples that occur at image borders. int x = max(dispatchThreadID.x - gBlurRadius, 0); gCache[groupThreadID.x] = gInput[int2(x, dispatchThreadID.y)]; } if (groupThreadID.x >= N - gBlurRadius) { // Clamp out of bound samples that occur at image borders. int x = min(dispatchThreadID.x + gBlurRadius, gInput.Length.x - 1); gCache[groupThreadID.x + 2 * gBlurRadius] = gInput[int2(x, dispatchThreadID.y)]; } // Clamp out of bound samples that occur at image borders. gCache[groupThreadID.x + gBlurRadius] = gInput[min(dispatchThreadID.xy, gInput.Length.xy - 1)]; // Wait for all threads to finish. GroupMemoryBarrierWithGroupSync(); // // Now blur each pixel. // float4 blurColor = float4(0, 0, 0, 0); [unroll] for (int i = -gBlurRadius; i <= gBlurRadius; ++i) { int k = groupThreadID.x + gBlurRadius + i; blurColor += gWeights[i + gBlurRadius] * gCache[k]; } gOutput[dispatchThreadID.xy] = blurColor; } and this is CSV static float gWeights[11] = { 0.05f, 0.05f, 0.1f, 0.1f, 0.1f, 0.2f, 0.1f, 0.1f, 0.1f, 0.05f, 0.05f, }; static const int gBlurRadius = 5; Texture2D gInput; RWTexture2D<float4> gOutput; #define N 256 #define CacheSize (256 + 2*5) groupshared float4 gCache[CacheSize]; [numthreads(1, N, 1)] void main(int3 groupThreadID : SV_GroupThreadID, int3 dispatchThreadID : SV_DispatchThreadID) { // // Fill local thread storage to reduce bandwidth. To blur // N pixels, we will need to load N + 2*BlurRadius pixels // due to the blur radius. // // This thread group runs N threads. To get the extra 2*BlurRadius pixels, // have 2*BlurRadius threads sample an extra pixel. if (groupThreadID.y < gBlurRadius) { // Clamp out of bound samples that occur at image borders. int y = max(dispatchThreadID.y - gBlurRadius, 0); gCache[groupThreadID.y] = gInput[int2(dispatchThreadID.x, y)]; } if (groupThreadID.y >= N - gBlurRadius) { // Clamp out of bound samples that occur at image borders. int y = min(dispatchThreadID.y + gBlurRadius, gInput.Length.y - 1); gCache[groupThreadID.y + 2 * gBlurRadius] = gInput[int2(dispatchThreadID.x, y)]; } // Clamp out of bound samples that occur at image borders. gCache[groupThreadID.y + gBlurRadius] = gInput[min(dispatchThreadID.xy, gInput.Length.xy - 1)]; // Wait for all threads to finish. GroupMemoryBarrierWithGroupSync(); // // Now blur each pixel. // float4 blurColor = float4(0, 0, 0, 0); [unroll] for (int i = -gBlurRadius; i <= gBlurRadius; ++i) { int k = groupThreadID.y + gBlurRadius + i; blurColor += gWeights[i + gBlurRadius] * gCache[k]; } gOutput[dispatchThreadID.xy] = blurColor; } sorry about poor english. plz help I'm really sad... I spend whole day for this... It doesn't work.. feels bad man..
  8. how to parse obj file?

    I think that's plane not part of rock model..
  9. I made .OBJ file parser. but something wierd happened. in OBJ file, there're 254 vertices. but in face section, it indicate 258th vertex. I attach file here.