Jump to content
  • Advertisement

sunsflower

Member
  • Content Count

    63
  • Joined

  • Last visited

Everything posted by sunsflower

  1. hi! I've just implemented OIT using the recipe in opengl4 shading language cookbook and I draw some quads. It works, but the diagonal line are less transparent as if fragments there are drawn twice. Then I drop my code and copy everything from the recipe in that book but the diagonal lines are still seen clearly...here is a screenshot: how could this happed?... [sharedmedia=gallery:images:7463]  
  2. sunsflower

    order independent transparency problem

    I actually have four vertices and six indices per quad, like float verticeData[] = {100, 100, 1, 100, 300, 1, 300, 300, 1, 300, 100, 1}; uint indexData[] = {0, 1, 2, 0, 2, 3}. There shouldn't be any different on the corner vertices I guess. But thanks for the help
  3. sunsflower

    order independent transparency problem

    "In this recipe, we'll use SSBOs and image load/store to implement order-independent transparency. We'll use two passes. In the first pass, we'll render the scene geometry and store a linked list of fragments for each pixel. After the first pass, each pixel will have a corresponding linked list containing all fragments that were written to that pixel including their depth and color. In the second pass, we'll draw a full-screen quad to invoke the fragment shader for each pixel. In the fragment shader, we'll extract the linked list for the pixel, sort the fragments by depth (largest to smallest), and blend the colors in that order. The final color will then be sent to the output device." some thing like that
  4. sunsflower

    order independent transparency problem

    I tried to use drawelements, but results are quite the sam. and I also tried to use triangle_fans and triangle_strips which doesn't work either...
  5. sunsflower

    questions

  6. sunsflower

    shot1

    From the album: questions

  7. hi, I wonder if anyone has made any larger game(many many renderings i mean) with love2d? or is it too slow to do that? thanks!
  8. If I have some shader functions to draw single meshes with large number of vertices, some brushes with gradient colors, some particles, should I put these functions in different render passes in a single program or in different programs? will switch programs will do much damage to performce?
  9. sunsflower

    opengl proper using of program

    sorry but I still dont get it...I mean if I have a fragment shader subroutine that use a texture and another subroutine that uses only vertex color, how can I merge these two into one in order to minimize states changes? seems impossible to me
  10. sunsflower

    opengl proper using of program

    sorry for the late reply... :( but in this way I have to compile many program objects and switch between them during runtime. if so, will it damage performance of thr program?
  11. sunsflower

    c++ gui library suitable for game?

    thanks, I find imgui to be very nice1
  12. hi! I wonder is there any good gui libraries for games? I've searched for some time but nothing is quite satisfying. those libs are without opengl support, or control the mainloop...Any advice? thanks!
  13. sunsflower

    c++ gui library suitable for game?

    and if I want to wirte an editor with opengl content, can I use imgui? or wxwidgets or cegui will be better? (should I even write one myself...) :)
  14. sunsflower

    opengl proper using of program

    ok, thanks very much!
  15. why we always use c++? what is the advantanges of c++ over c in game development? and does making game with c makes sense at all?
  16. are there any good websites for game ai programming? such as reinforce learning or something else..  
  17. sunsflower

    Is making game with c possible?

    oh thanks very much! I guess I should go on writing the game instead of sticking to such questions...
  18. I'm using transform feedback to build a particle system, here is vertex shader outputs(first three are seperate feedbacks, last two are used by subroutine in fragment shader(not all of them at the same time)). I use subroutines in both vertex and fragment shaders. however when running the program, exception throwed at glBeginTransformFeedback(GL_POINTS). But if I remove the FTransp output, it works well. Is there any limitations on vertex shader output number? or something else? I don't know what info is useful to solve this problem, so please do point it to me and I'll post the info needed. Thanks!   out vec2 Position; out vec2 Vel; out float StartTime; out vec2 FCoord; out float FTransp;  
  19. I wrote this in lua: body1 = physics.newbody("dynamic", 500, 100, 0) body1:applyforce(10000, 0) node2 = graphics.new_physnode(node1, body1, "phys1") body1:applyforce(10000, 0) the first time I called applyforce, it worked well. But at the second time, it became a nil value. So maybe it's the new_physnode that mess things up? this is new_physnode: int l_new_physnode(lua_State* L) { ShapeNode* shapenode = (ShapeNode*)lua_touserdata(L, 1); Physics::hdbody body = (Physics::hdbody)lua_touserdata(L, 2); string name = lua_tostring(L, 3); PhysNode* physnode = graphics.new_physnode(shapenode, body, name); lua_pushlightuserdata(L, physnode); luaL_getmetatable(L, "Lua.Node"); lua_setmetatable(L, -2); return 1; } it will just copy the pointer of body and shapenode then store them in physnode. yet I cannot get it to work. Why this is happening?(body's metatable becomes null but node's metatable remain the same...) thanks!
  20. sunsflower

    Lua(jit) userdata metatable lost ?

    ...userdata has to be a block of memory which means I'll have to put the node's memory in it. What if I just want the function to return a pointer with a metatable instead of allocate new memory?(I shall manage memory in c++)
  21. sunsflower

    Lua(jit) userdata metatable lost ?

    Physics::hdbody is a pointer...and light userdata has no metatables? Oh, I think that's the point! thanks very much!
  22. thanks very much! It does work!
  23. I just download luajit from official site and then I do "mingw32-make" in luajit folder. The compilation succeeded and produce a lua51.dll, a luajit.exe and nothing else. I cannot link my program with luajit thus. What should I do to get the lib*.a file of luajit? thanks!
  24. thanks a lot!!! very helpful answers!! I'm now clearer on these questions! (wht can't I add an emoji...)
  25. It's about VAO, VBO, glGenBuffers, glBindBuffer and glBufferData... As far as I know(or quess), VAO and VBO are stored in the graphics card memory. And when I call glGenBuffers, I create some sort of a identifier on graphics card and glBindBuffer implement some current identifier. glBufferData will upload data from cpu memory to gpu memory. so glBufferData(glBufferSubData may be the same) is not very efficient and should be avoided in update function. are those statement actually right? thanks!
  • 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!