Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

111 Neutral

About _rapt0r

  • Rank
  1. ??? ?????? ?????? ????? ? ????? (?????) http://j.mp/qLbuPP
  2. I use a 64-bit bitfield. For the look-up, to find a shader that satisfies some particular combination of states, I use a linear search. ShaderPrograms* FindProgramsForStates( u64 stateBitfield ) { for( int i=0; i != m_permutations.size(); ++i ) { u64 shaderStates = m_permutations->supportedStates; if( (stateBitfield & shaderStates) == shaderStates ) return m_permutations->shaderPrograms; } //a valid permutation should always be found, this code should never be reached. assert(false); return NULL; } [/quote] How do you combine this states with material shaders (created by user)? For example, if I want a material shader with stream instancing with two lights for PS3...
  3. I'm thinking about resource system design and I need some review/advises. The main purposes is: * Don't use interfaces * High level render components must know nothing about low level render api. * Persomance So, I have high level render components (Mesh renderer, UI, Decal renderer) which must interact with low level renderer api (using some common structures - VertexBuffer, IndexBuffer, Texture2D, Shader, ...) Here is pseudo code: struct RenderResource { handle Handle; // Low level api handle (could be int or void *) uint Type; // Resource type void Create() { RenderDevice->CreateResource(this); Queue->Register(this); } void Destroy() { RenderDevice->DestroyResource(this); Queue->Unregister(this); } } struct VertexBuffer : RenderResource { VertexBuffer() : Type(VB) { } ~VertexBuffer() {} Stride, Count, Data Ptr. } struct Texture2D : RenderResource { Texture2D() : Type(TEX) {} Width Height } Eash low level renderer contains similar structures, which creates/updates resources from high-level component: struct D3D11VertexBuffer { ID3D11Buffer * Buffer; void Create(VertexBuffer * Buf) { // Buffer creation here.. } }; void Renderer::Create(RenderResource * Resource) { switch(Resource->Type) { case VB: { D3D11VertexBuffer * VB = new D3D11VertexBuffer(); VB->Create((VertexBuffer *)Resource); Resource->Handle = VB; return; } } } Its an idea, but if anybody has any improvements, ideas, etc, say so.
  4. How do you convert High-level 'Drawables' to RenderInstance objects? Is it common structure for all entities or every entity type has its one structure, that low level render system knows about?
  5. Thank you for your reply, I did not understand what is draw-call structure in your system? * a draw-call (e.g. a structure that maps to DrawIndexedPrimitive etc, and an enum saying which one it's mapping to) Why do you map draw functions?
  6. One more question. Now very popular to make multi threaded renderers with command buffers (render block in frostbite, draw parts in killzone 2, etc). In short the algorithm is as follows: * Create render block (with geometry, shader, constants, texture list, flags,etc) * Add to render queue Later * Sort, set and draw The problem is that there are so many objects that are rendered in different ways, its not as simple as just passing an index and vertex buffer. And what happens with all the data for that object that needs to be rendered? May be somebody implemented similar systems. Thanks.
  7. Their system generates solutions offline. See page 34.
  8. Now it is clear. Many thanks!
  9. Hello. I was reading old Dice presentation from GDC 07 about Frostbite engine rendering architecture (slideshare). Most of it is pretty easy to understand, but I can't seem to comprehend how do they designed high-level states for render system (how do they pass dynamic number of state combinations to shading system and how to find solution for that combinations efficiently) (page 35). * User queues up render blocks Geometry & high--level state combinations * Looks up solutions for the state combinations Pipeline created these offline * Blocks dispatched by backend to D3D/GCM Blocks dispatched by backend to D3D/GCM Blocks are sorted (category & depth) Backend sets platform--specific states and shaders Determined by pipeline for that solution Thin & dumb Thin & dumb Draw Can anyone help me with some pseudocode that implements? Many thanks.
  10. If a programming language was a boat… http://t.co/NEevB2b
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!