09/12/2017

Tasks:

  • Due Wed: Meet Varshney
    • GrayScale Rendering
      • I searched: single channel textures, grayscale framebuffer.
      • https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml
      • Solution: Dropbox\OPENGL\TrySomething\Sponza\grayScaleRendering
      • Compare GL_RGB & GL_RED
      •                          Memory             Time
      • GL_RGB        386MB               24ms
      • GL_RED        350MB               24ms
      • Cannot do better if reduce color
      • One question: How to render to frame in one channel?
    • Strange meshes
  • Due Wed: Watch video of CMSC726 (Should do this evening)
  • Due Fri: HW2 CMSC726 (should finish it on Wed)
  • Dur Sep.21: CMSC740 HW3, should finish during weekend
  • Should summarize CMSC740 contents this weekend

Others:

  • Bug for log polar transformation for meshes:
    • 1. Is it caused by input quads?
      • I guess no. As https://www.opengl.org/discussion_boards/showthread.php/175665-Geometry-shader-to-handle-quads said, those types (quads) are all tessellated by the driver to triangles before being passed to the geometry shader. Each quad would be split into two triangles and these would be processed separately by the geometry shader.

09/06/2017

Research:

  • Fixed depth error. Should initialize depth buffer after obj load
  • Fixed drawing triangles for the cut line:
    • I wrongly set the “layout (triangle_strip, max_vertices = 3) out”, if max_vertices = 3, only one triangle will be outputted!
  • Should use vertex, tess, geom, frag shaders together now! Let recall the whole pipeline…https://www.khronos.org/opengl/wiki/Rendering_Pipeline_Overview
  • (09/08 added) I met an error for tessellation:
  • Use tessellation CTRL shader to determine the level of tessellation:
    • how to determine the level dynamically? Can do this
    • Ensure that the shared edge(s) between the patches use the same level of tessellation
  • Use tessellation eval shader to calculate the area of the triangle.
  • ——————————————————————————————————————————
  • How to dynamically solve the problem of tessellation?
  • Central Triangle??

Others:

…悲剧就是将美好的东西毁灭给人看…

09/05/2017

Problem:

Could load texture correctly when rendering to framebuffer. However, when framebuffer is used, only left down corner of the texture is displayed.

Solve:

I loaded a model with some texture initialization before initiating framebuffer. And the model affected the initialization of framebuffer;

Should initialize framebuffer before loading the model.

Task for tomorrow:

Try every simple mesh in the object separately.

KNN

Assignment1: KNN

  • Install BallTree Library: sudo apt-get install python-sklearn
  • list.append(), add new item to the end.
  • numpy.arange(), sort
  • numpy.reshape(), the same with reshape() in matlab
  • numpy.median(numpy.array(outs))????
  • defaultDict.get(), https://stackoverflow.com/questions/11041405/why-dict-getkey-instead-of-dictkey
  • ballTree.query(X, k == k_in), http://scikit-learn.org/stable/modules/generated/sklearn.neighbors.BallTree.html

09/01/2017

  1. Find large model
    1. Can load Sponza
    2. The loading library is not complete. The .mtl cannot be fully loaded. But the rendering time can achieve >28ms
  2. Color:
    1. Patney: people can easily find difference if color is changed.
  3. Use short in to replace float

*.mtl content explanation

newmtl mtlName # mtlName is the name of the material

Ka 1.000 1.000 1.000 #材质的阴影色(ambient color)用Ka声明。颜色用RGB定义,每条通道的值从0到1之间取。

Kd 1.000 1.000 1.000 #固有色(diffuse color)

Ks 0.000 0.000 0.000 #高光色(specular color), if black {specular color is closed}

Ns 10.000 #Use Ns to represent weighted specular color, range 0 – 1000

illum 2 #illumination mode

0. 色彩开,阴影色关
1. 色彩开,阴影色开
2. 高光开
3. 反射开,光线追踪开
4. 透明: 玻璃开 反射:光线追踪开
5. 反射:菲涅尔衍射开,光线追踪开
6. 透明:折射开 反射:菲涅尔衍射关,光线追踪开
7. 透明:折射开 反射:菲涅尔衍射开,光线追踪开
8. 反射开,光线追踪关
9. 透明: 玻璃开 反射:光线追踪关
10. 投射阴影于不可见表面

d 0.9 # dissolve? 有些用’d’实现
Tr 0.9 # 其他的用’Tr’

map_Ka lena.tga # 阴影色纹理贴图
map_Kd lena.tga # 固有色纹理贴图 (多数情况下与其阴影色纹理贴图相同)
map_Ks lena.tga # 高光色纹理贴图
map_d lena_alpha.tga # alpha通道纹理贴图
map_bump lena_bump.tga # 凹凸贴图
bump lenna_bump.tga # 也有用’bump’而非’map_Bump’标签

For textures:

.dif are for diffuse

.alpha are for transparentcy

.spec are for specular reflection

.ddn are tengent space normal maps

.BGR?

08/30/2017

Plan for tomorrow:

  1. try to download dependency of https://github.com/NCCA/Sponza
  2. if not work, try to load the textures
  3. Change from single float to short in for peripheral pixels
  4. finish homework for 726 in python