• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By ANIO chan
      Hi, I'm new here and would like to get some help in what i should do first when designing a game? What would you consider to be the best steps to begin designing my game? Give resources with it as well please.
    • By lucky6969b
      How do you handle situations where the physics engine produces a 129x129 height field which results in 2M vertexes for every frame. The frame rate suffers a lot, and drops to 2-3 fps.
      Is there a way to reduce the traffic or burden over the graphics card? Is the technique of LOD and progressive mesh still apply?
    • By KarimIO
      Hey guys! Two questions:
      1) Is there a benefit to Vulkan and DirectX's Shader State for the Constant/Uniform Buffer? In these APIs, and NOT in OpenGL, you must set which shader is going to take each buffer. Why is this? For allowing more slots?
      2) I'm building an wrapper over these graphics APIs, and was wondering how to handle passing parameters. In addition, I used my own json format to describe material formats and shader formats. In this, I can describe which shaders get what uniform buffers. I was thinking of moving to support ShaderLab (Unity's shader format) instead, as this would allow people to jump over easily enough and ease up the learning curve. But ShaderLab does not support multiple Uniform Buffers at all, as I can tell, let alone what parameters go where. 
      So to fix this, I was just going to send all Uniform Buffers to all shaders. Is this that big of a problem?
      3) Do you have any references on how to organize material uniform buffers? I may be optimizing too early, but I've seen people say what a toll this can take.
    • By stale
      I've just started learning about tessellation from Frank Luna's DX11 book. I'm getting some very weird behavior when I try to render a tessellated quad patch if I also render a mesh in the same frame. The tessellated quad patch renders just fine if it's the only thing I'm rendering. This is pictured below:
      However, when I attempt to render the same tessellated quad patch along with the other entities in the scene (which are simple triangle-lists), I get the following error:

      I have no idea why this is happening, and google searches have given me no leads at all. I use the following code to render the tessellated quad patch:
      ID3D11DeviceContext* dc = GetGFXDeviceContext(); dc->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST); dc->IASetInputLayout(ShaderManager::GetInstance()->m_JQuadTess->m_InputLayout); float blendFactors[] = { 0.0f, 0.0f, 0.0f, 0.0f }; // only used with D3D11_BLEND_BLEND_FACTOR dc->RSSetState(m_rasterizerStates[RSWIREFRAME]); dc->OMSetBlendState(m_blendStates[BSNOBLEND], blendFactors, 0xffffffff); dc->OMSetDepthStencilState(m_depthStencilStates[DSDEFAULT], 0); ID3DX11EffectTechnique* activeTech = ShaderManager::GetInstance()->m_JQuadTess->Tech; D3DX11_TECHNIQUE_DESC techDesc; activeTech->GetDesc(&techDesc); for (unsigned int p = 0; p < techDesc.Passes; p++) { TerrainVisual* terrainVisual = (TerrainVisual*)entity->m_VisualComponent; UINT stride = sizeof(TerrainVertex); UINT offset = 0; GetGFXDeviceContext()->IASetVertexBuffers(0, 1, &terrainVisual->m_VB, &stride, &offset); Vector3 eyePos = Vector3(cam->m_position); Matrix rotation = Matrix::CreateFromYawPitchRoll(entity->m_rotationEuler.x, entity->m_rotationEuler.y, entity->m_rotationEuler.z); Matrix model = rotation * Matrix::CreateTranslation(entity->m_position); Matrix view = cam->GetLookAtMatrix(); Matrix MVP = model * view * m_ProjectionMatrix; ShaderManager::GetInstance()->m_JQuadTess->SetEyePosW(eyePos); ShaderManager::GetInstance()->m_JQuadTess->SetWorld(model); ShaderManager::GetInstance()->m_JQuadTess->SetWorldViewProj(MVP); activeTech->GetPassByIndex(p)->Apply(0, GetGFXDeviceContext()); GetGFXDeviceContext()->Draw(4, 0); } dc->RSSetState(0); dc->OMSetBlendState(0, blendFactors, 0xffffffff); dc->OMSetDepthStencilState(0, 0); I draw my scene by looping through the list of entities and calling the associated draw method depending on the entity's "visual type":
      for (unsigned int i = 0; i < scene->GetEntityList()->size(); i++) { Entity* entity = scene->GetEntityList()->at(i); if (entity->m_VisualComponent->m_visualType == VisualType::MESH) DrawMeshEntity(entity, cam, sun, point); else if (entity->m_VisualComponent->m_visualType == VisualType::BILLBOARD) DrawBillboardEntity(entity, cam, sun, point); else if (entity->m_VisualComponent->m_visualType == VisualType::TERRAIN) DrawTerrainEntity(entity, cam); } HR(m_swapChain->Present(0, 0)); Any help/advice would be much appreciated!
    • By RenderPixel
      I have just started writing shaders recently (a couple of weeks ago.) (Background info in another post here.) I decided to start with a basic phong shader. I understand (I think) the implementation of the diffuse and specular refleections. 
      Diffuse reflection = (N.L)
      Specular reflection = (R.V)^S   where s = specular power. 
      Reflection vector = 2* (N.L)*N-L
      I have a shader put together for fx composer 2.5 that is an attempt at the phong lighting model. (Shader code linked.) I have not added in the texture sample to the pixel shader output yet since I am trying to debug lighting model issues. The diffuse reflection works fine, however, the specular reflection is giving me some trouble. 
      The problem I am experience is that the specular reflection (shown here) seems to affect the back of the sphere. 
      When I saturate the specular reflection value I get this: (If saturate clamps input to min=0 and max=1, I do not know where these values on the back are coming from since negative values should just get clamped to 0.)

      If I remove the saturate from the specular reflection and add the difuse reflection to the specular reflection I get this.  (I will post an image of my diffuse reflection below to show how it looks on its own. )

      Diffuse reflection by itself. 

      What am I missing here?
      Also, I am completely open to feedback on my shader. I am looking to learn anything I can here.  Thank you in advance for your time.

  • Advertisement
  • Advertisement

3D Auto rigging algorithm for cubical-voxels models

Recommended Posts

Hi everyone, thank you for your attention.

I'm making a 3D model editor based on voxel, to create models which looks like cubeworld ones (see https://i.stack.imgur.com/y5SWz.jpg)

I've implemented a skeleton-key frames animation system. (My model has a mesh of vertices, and each vertices has a list of bones and weights, to determine how much a bone transformation affects the final vertex transformation)

**And now, I'm looking for an algorithm to generate vertex bones weights automatically. I have each vertex position and bone position/rotation/size relatively to the model referential.**

(Blender does implement this functionality https://blender.stackexchange.com/questions/782/how-can-i-automatically-generate-vertex-groups-for-an-armature )

PS: Google searching "auto rigging algorithm" actually gives some essays, but as I'm using voxel (as raw cubes), I would be glad to find something more specific/optimized/good looking

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

  • Advertisement