├── .gitignore ├── .travis.yml ├── README.md ├── docs ├── 01 Getting started │ ├── 01 OpenGL.md │ ├── 02 Creating a window.md │ ├── 03 Hello Window.md │ ├── 04 Hello Triangle.md │ ├── 05 Shaders.md │ ├── 06 Textures.md │ ├── 07 Transformations.md │ ├── 08 Coordinate Systems.md │ ├── 09 Camera.md │ └── 10 Review.md ├── 02 Lighting │ ├── 01 Colors.md │ ├── 02 Basic Lighting.md │ ├── 03 Materials.md │ ├── 04 Lighting maps.md │ ├── 05 Light casters.md │ ├── 06 Multiple lights.md │ └── 07 Review.md ├── 03 Model Loading │ ├── 01 Assimp.md │ ├── 02 Mesh.md │ └── 03 Model.md ├── 04 Advanced OpenGL │ ├── 01 Depth testing.md │ ├── 02 Stencil testing.md │ ├── 03 Blending.md │ ├── 04 Face culling.md │ ├── 05 Framebuffers.md │ ├── 06 Cubemaps.md │ ├── 07 Advanced Data.md │ ├── 08 Advanced GLSL.md │ ├── 09 Geometry Shader.md │ ├── 10 Instancing.md │ └── 11 Anti Aliasing.md ├── 05 Advanced Lighting │ ├── 01 Advanced Lighting.md │ ├── 02 Gamma Correction.md │ ├── 03 Shadows │ │ ├── 01 Shadow Mapping.md │ │ ├── 02 Point Shadows.md │ │ └── 03 CSM.md │ ├── 04 Normal Mapping.md │ ├── 05 Parallax Mapping.md │ ├── 06 HDR.md │ ├── 07 Bloom.md │ ├── 08 Deferred Shading.md │ └── 09 SSAO.md ├── 06 In Practice │ ├── 01 Debugging.md │ ├── 02 Text Rendering.md │ └── 2D-Game │ │ ├── 01 Breakout.md │ │ ├── 02 Setting up.md │ │ ├── 03 Rendering Sprites.md │ │ └── 06 Particles.md ├── 07 PBR │ ├── 01 Theory.md │ ├── 02 Lighting.md │ └── 03 IBL.md ├── css │ ├── admonition_fix.css │ └── style.css ├── img │ ├── 01 │ │ ├── 01 │ │ │ └── opengl.jpg │ │ ├── 02 │ │ │ ├── cmake.png │ │ │ ├── glfw.png │ │ │ ├── include_directories.png │ │ │ ├── linker_input.png │ │ │ └── vc_directories.png │ │ ├── 03 │ │ │ ├── hellowindow.png │ │ │ └── hellowindow2.png │ │ ├── 04 │ │ │ ├── hellotriangle.png │ │ │ ├── hellotriangle2.png │ │ │ ├── ndc.png │ │ │ ├── pipeline.png │ │ │ ├── vertex_array_objects.png │ │ │ ├── vertex_array_objects_ebo.png │ │ │ └── vertex_attribute_pointer.png │ │ ├── 05 │ │ │ ├── shaders.mp4 │ │ │ ├── shaders.png │ │ │ ├── shaders3.png │ │ │ └── vertex_attribute_pointer_interleaved.png │ │ ├── 06 │ │ │ ├── awesomeface.png │ │ │ ├── container.jpg │ │ │ ├── filter_linear.png │ │ │ ├── filter_nearest.png │ │ │ ├── mipmaps.png │ │ │ ├── tex_coords.png │ │ │ ├── texture_filtering.png │ │ │ ├── texture_wrapping.png │ │ │ ├── textures.png │ │ │ ├── textures2.png │ │ │ ├── textures_combined.png │ │ │ ├── textures_combined2.png │ │ │ ├── textures_funky.png │ │ │ ├── vertex_attribute_pointer_interleaved_textures.png │ │ │ └── wall.jpg │ │ ├── 07 │ │ │ ├── glm.png │ │ │ ├── matrix_multiplication.png │ │ │ ├── transformations.mp4 │ │ │ ├── transformations.png │ │ │ ├── vectors.png │ │ │ ├── vectors_addition.png │ │ │ ├── vectors_angle.png │ │ │ ├── vectors_crossproduct.png │ │ │ ├── vectors_scale.png │ │ │ ├── vectors_subtraction.png │ │ │ └── vectors_triangle.png │ │ ├── 08 │ │ │ ├── coordinate_system_depth.mp4 │ │ │ ├── coordinate_system_no_depth.mp4 │ │ │ ├── coordinate_systems.png │ │ │ ├── coordinate_systems_multiple_objects.png │ │ │ ├── coordinate_systems_result.png │ │ │ ├── coordinate_systems_right_handed.png │ │ │ ├── orthographic_frustum.png │ │ │ ├── perspective.png │ │ │ ├── perspective_frustum.png │ │ │ └── perspective_orthographic.png │ │ └── 09 │ │ │ ├── camera_axes.png │ │ │ ├── camera_circle.mp4 │ │ │ ├── camera_inside.mp4 │ │ │ ├── camera_mouse.mp4 │ │ │ ├── camera_pitch.png │ │ │ ├── camera_pitch_yaw_roll.png │ │ │ ├── camera_smooth.mp4 │ │ │ ├── camera_triangle.png │ │ │ └── camera_yaw.png │ ├── 02 │ │ ├── 01 │ │ │ ├── colors_scene.png │ │ │ └── light_reflection.png │ │ ├── 02 │ │ │ ├── ambient_lighting.png │ │ │ ├── basic_lighting_diffuse.png │ │ │ ├── basic_lighting_gouruad.png │ │ │ ├── basic_lighting_normal_transformation.png │ │ │ ├── basic_lighting_phong.png │ │ │ ├── basic_lighting_specular.png │ │ │ ├── basic_lighting_specular_shininess.png │ │ │ ├── basic_lighting_specular_theory.png │ │ │ └── diffuse_light.png │ │ ├── 03 │ │ │ ├── materials.mp4 │ │ │ ├── materials_light.png │ │ │ ├── materials_real_world.png │ │ │ └── materials_with_material.png │ │ ├── 04 │ │ │ ├── container2.png │ │ │ ├── container2_specular.png │ │ │ ├── lighting_maps_exercise3.png │ │ │ ├── lighting_maps_specular_color.png │ │ │ ├── materials_diffuse_map.png │ │ │ ├── materials_specular_map (1).png │ │ │ ├── materials_specular_map.png │ │ │ └── matrix.jpg │ │ ├── 05 │ │ │ ├── attenuation.png │ │ │ ├── light_casters_cos.png │ │ │ ├── light_casters_directional.png │ │ │ ├── light_casters_directional_light.png │ │ │ ├── light_casters_point.png │ │ │ ├── light_casters_point_light.png │ │ │ ├── light_casters_spotlight.png │ │ │ ├── light_casters_spotlight_angles.png │ │ │ ├── light_casters_spotlight_hard.png │ │ │ └── materials_diffuse_map.png │ │ └── 06 │ │ │ ├── multiple_lights_atmospheres.png │ │ │ └── multiple_lights_combined.png │ ├── 03 │ │ ├── 01 │ │ │ └── assimp_structure.png │ │ └── 03 │ │ │ ├── model_diffuse.png │ │ │ └── model_lighting.png │ ├── 04 │ │ ├── 10 │ │ │ ├── instancing_asteroids.png │ │ │ ├── instancing_asteroids_quantity.png │ │ │ ├── instancing_quads.png │ │ │ └── instancing_quads_arrays.png │ │ ├── 11 │ │ │ ├── anti_aliasing_aliasing.png │ │ │ ├── anti_aliasing_multisampled.png │ │ │ ├── anti_aliasing_post_processing.png │ │ │ ├── anti_aliasing_rasterization.png │ │ │ ├── anti_aliasing_rasterization_filled.png │ │ │ ├── anti_aliasing_rasterization_samples.png │ │ │ ├── anti_aliasing_rasterization_samples_filled.png │ │ │ ├── anti_aliasing_sample_points.png │ │ │ └── anti_aliasing_zoomed.png │ │ ├── 01 │ │ │ ├── depth_linear_graph.png │ │ │ ├── depth_non_linear_graph.png │ │ │ ├── depth_testing_func_always.png │ │ │ ├── depth_testing_func_less.png │ │ │ ├── depth_testing_visible_depth.png │ │ │ ├── depth_testing_visible_linear.png │ │ │ └── depth_testing_z_fighting.png │ │ ├── 02 │ │ │ ├── stencil_buffer.png │ │ │ ├── stencil_object_outlining.png │ │ │ └── stencil_scene_outlined.png │ │ ├── 03 │ │ │ ├── blending_discard.png │ │ │ ├── blending_equation.png │ │ │ ├── blending_equation_mixed.png │ │ │ ├── blending_incorrect_order.png │ │ │ ├── blending_no_discard.png │ │ │ ├── blending_sorted.png │ │ │ ├── blending_transparency.png │ │ │ ├── blending_transparent_window.png │ │ │ └── grass.png │ │ ├── 04 │ │ │ ├── faceculling_frontback.png │ │ │ ├── faceculling_reverse.png │ │ │ └── faceculling_windingorder.png │ │ ├── 05 │ │ │ ├── container.jpg │ │ │ ├── framebuffers_blur.png │ │ │ ├── framebuffers_edge_detection.png │ │ │ ├── framebuffers_grayscale.png │ │ │ ├── framebuffers_inverse.png │ │ │ ├── framebuffers_mirror.png │ │ │ ├── framebuffers_screen_texture.png │ │ │ └── framebuffers_sharpen.png │ │ ├── 06 │ │ │ ├── cubemaps_morrowind.jpg │ │ │ ├── cubemaps_reflection.png │ │ │ ├── cubemaps_reflection_map.png │ │ │ ├── cubemaps_reflection_nanosuit.png │ │ │ ├── cubemaps_reflection_theory.png │ │ │ ├── cubemaps_refraction.png │ │ │ ├── cubemaps_refraction_theory.png │ │ │ ├── cubemaps_sampling.png │ │ │ ├── cubemaps_skybox.png │ │ │ ├── cubemaps_skybox_result.png │ │ │ ├── nanosuit_reflection.zip │ │ │ └── skybox.rar │ │ ├── 08 │ │ │ ├── advanced_glsl_binding_points.png │ │ │ ├── advanced_glsl_fragcoord.png │ │ │ ├── advanced_glsl_frontfacing.png │ │ │ ├── advanced_glsl_pointsize.png │ │ │ └── advanced_glsl_uniform_buffer_objects.png │ │ └── 09 │ │ │ ├── geometry_shader_explosion.png │ │ │ ├── geometry_shader_house.png │ │ │ ├── geometry_shader_houses.png │ │ │ ├── geometry_shader_houses_colored.png │ │ │ ├── geometry_shader_houses_snow.png │ │ │ ├── geometry_shader_line_strip.png │ │ │ ├── geometry_shader_lines.png │ │ │ ├── geometry_shader_normals.png │ │ │ ├── geometry_shader_points.png │ │ │ └── geometry_shader_triangle_strip.png │ ├── 05 │ │ ├── 01 │ │ │ ├── advanced_lighting_comparrison.png │ │ │ ├── advanced_lighting_comparrison2.png │ │ │ ├── advanced_lighting_halfway_vector.png │ │ │ ├── advanced_lighting_over_90.png │ │ │ └── advanced_lighting_phong_limit.png │ │ ├── 02 │ │ │ ├── gamma_correction_attenuation.png │ │ │ ├── gamma_correction_brightness.png │ │ │ ├── gamma_correction_example.png │ │ │ ├── gamma_correction_gamma_curves.png │ │ │ └── gamma_correction_srgbtextures.png │ │ ├── 03 │ │ │ ├── 01 │ │ │ │ ├── shadow_mapping_acne.png │ │ │ │ ├── shadow_mapping_acne_bias.png │ │ │ │ ├── shadow_mapping_acne_diagram.png │ │ │ │ ├── shadow_mapping_clamp_edge.png │ │ │ │ ├── shadow_mapping_culling.png │ │ │ │ ├── shadow_mapping_depth_map.png │ │ │ │ ├── shadow_mapping_outside_frustum.png │ │ │ │ ├── shadow_mapping_over_sampling_fixed.png │ │ │ │ ├── shadow_mapping_peter_panning.png │ │ │ │ ├── shadow_mapping_projection.png │ │ │ │ ├── shadow_mapping_shadows.png │ │ │ │ ├── shadow_mapping_soft_shadows.png │ │ │ │ ├── shadow_mapping_theory.png │ │ │ │ ├── shadow_mapping_theory_spaces.png │ │ │ │ ├── shadow_mapping_with_bias.png │ │ │ │ ├── shadow_mapping_with_without.png │ │ │ │ └── shadow_mapping_zoom.png │ │ │ └── 02 │ │ │ │ ├── point_shadows.png │ │ │ │ ├── point_shadows_depth_cubemap.png │ │ │ │ ├── point_shadows_diagram.png │ │ │ │ ├── point_shadows_soft.png │ │ │ │ └── point_shadows_soft_better.png │ │ ├── 04 │ │ │ ├── normal_mapping_compare.png │ │ │ ├── normal_mapping_comparison.png │ │ │ ├── normal_mapping_complex_compare.png │ │ │ ├── normal_mapping_correct.png │ │ │ ├── normal_mapping_correct_tangent.png │ │ │ ├── normal_mapping_flat.png │ │ │ ├── normal_mapping_ground.png │ │ │ ├── normal_mapping_ground_normals.png │ │ │ ├── normal_mapping_normal_map.png │ │ │ ├── normal_mapping_surface_edges.png │ │ │ ├── normal_mapping_surfaces.png │ │ │ ├── normal_mapping_tbn_shown.png │ │ │ └── normal_mapping_tbn_vectors.png │ │ ├── 05 │ │ │ ├── parallax_mapping.png │ │ │ ├── parallax_mapping_depth.png │ │ │ ├── parallax_mapping_edge_fix.png │ │ │ ├── parallax_mapping_height_map.png │ │ │ ├── parallax_mapping_incorrect_p.png │ │ │ ├── parallax_mapping_issues.png │ │ │ ├── parallax_mapping_parallax_occlusion_mapping.png │ │ │ ├── parallax_mapping_parallax_occlusion_mapping_diagram.png │ │ │ ├── parallax_mapping_plane_height.png │ │ │ ├── parallax_mapping_plane_heightmap.png │ │ │ ├── parallax_mapping_scaled_height.png │ │ │ ├── parallax_mapping_steep_artifact.png │ │ │ ├── parallax_mapping_steep_parallax_mapping.png │ │ │ └── parallax_mapping_steep_parallax_mapping_diagram.png │ │ ├── 06 │ │ │ ├── hdr_clamped.png │ │ │ ├── hdr_direct.png │ │ │ ├── hdr_exposure.png │ │ │ ├── hdr_image.png │ │ │ └── hdr_reinhard.png │ │ ├── 07 │ │ │ ├── bloom.png │ │ │ ├── bloom_attachments.png │ │ │ ├── bloom_blurred.png │ │ │ ├── bloom_blurred_large.png │ │ │ ├── bloom_example.png │ │ │ ├── bloom_extracted.png │ │ │ ├── bloom_gaussian.png │ │ │ ├── bloom_gaussian_two_pass.png │ │ │ ├── bloom_scene.png │ │ │ ├── bloom_small.png │ │ │ └── bloom_steps.png │ │ ├── 08 │ │ │ ├── deferred_example.png │ │ │ ├── deferred_g_buffer.png │ │ │ ├── deferred_light_volume_rendered.png │ │ │ ├── deferred_lights_depth.png │ │ │ ├── deferred_lights_no_depth.png │ │ │ ├── deferred_overview.png │ │ │ └── deferred_shading.png │ │ └── 09 │ │ │ ├── ssao.png │ │ │ ├── ssao_banding_noise.jpg │ │ │ ├── ssao_crysis.jpg │ │ │ ├── ssao_crysis_circle.png │ │ │ ├── ssao_example.png │ │ │ ├── ssao_final.png │ │ │ ├── ssao_hemisphere (1).png │ │ │ ├── ssao_hemisphere.png │ │ │ ├── ssao_kernel_weight.png │ │ │ ├── ssao_overview.png │ │ │ ├── ssao_range_check.png │ │ │ ├── ssao_smoothstep.png │ │ │ └── ssao_without_blur.png │ ├── 06 │ │ ├── 01 │ │ │ ├── debugging_debug_output.png │ │ │ ├── debugging_debug_output_breakpoint.png │ │ │ ├── debugging_external_codexl.png │ │ │ ├── debugging_external_gdebugger.png │ │ │ ├── debugging_external_nsight.png │ │ │ ├── debugging_external_renderdoc.png │ │ │ ├── debugging_fbo_output.png │ │ │ ├── debugging_glgeterror.png │ │ │ ├── debugging_glsl_output.png │ │ │ └── debugging_glsl_reference_compiler.png │ │ ├── 02 │ │ │ ├── bitmapfont.png │ │ │ ├── glyph.png │ │ │ ├── glyph_offset.png │ │ │ ├── text_rendering.png │ │ │ └── text_rendering_quads.png │ │ └── Breakout │ │ │ ├── 01 │ │ │ ├── breakout2600.png │ │ │ └── cover.png │ │ │ ├── 02 │ │ │ └── setting-up.png │ │ │ ├── 03 │ │ │ ├── awesomeface.png │ │ │ ├── projection.png │ │ │ ├── rendering-sprites.png │ │ │ └── rotation-origin.png │ │ │ └── 06 │ │ │ ├── particle.png │ │ │ ├── particles.mp4 │ │ │ └── particles_example.jpg │ ├── README.md │ ├── development.png │ └── index_image2.png ├── index.md └── intro.md ├── glossary.md ├── mdx_math.py ├── mkdocs.yml ├── old ├── 01 │ ├── 04 Hello Triangle.md │ ├── 04 Hello Window.md │ ├── 05 Shaders.md │ ├── 06 Textures.md │ └── 07 Transformations.md ├── 05 │ └── 07 Bloom.md ├── 06 │ └── 03 2D Game.md └── img │ ├── 01-08-01.png │ ├── 01 │ ├── 04 │ │ └── ndc.png │ └── 07 │ │ ├── matrix_multiplication.png │ │ ├── vectors.png │ │ ├── vectors_addition.png │ │ ├── vectors_scale.png │ │ ├── vectors_subtraction.png │ │ └── vectors_triangle.png │ ├── 05_01_01.png │ ├── 05_01_F_depth.png │ ├── 05_01_F_depth_nonliner.png │ ├── 05_05_Edge_detection.png │ ├── 05_05_blur_sample.png │ ├── 05_05framebuffers_ kernel_sample.png │ ├── 5256.png │ ├── F_light.png │ ├── I.png │ ├── I_max.png │ ├── Kc.png │ ├── Kl.png │ ├── Kq.png │ ├── Light_casters1.png │ ├── Light_casters2.png │ ├── Light_casters3.png │ ├── OpenGL_pipline_cn.png │ ├── blending_C_result.png │ ├── camera3.png │ ├── camera4.png │ ├── coordinate_system_1.png │ ├── coordinate_system_2.png │ ├── d.png │ ├── deferred_shading_1.png │ ├── deferred_shading_2.png │ ├── deferred_shading_3.png │ ├── deferred_shading_4.png │ ├── deferred_shading_5.png │ ├── deferred_shading_6.png │ ├── deferred_shading_7.png │ ├── deferred_shading_8.png │ ├── epsilon.png │ ├── gamma.png │ ├── look_at.png │ ├── look_at_D.png │ ├── look_at_P.png │ ├── look_at_R.png │ ├── look_at_U.png │ ├── phi.png │ ├── quad_formula.png │ ├── shaders1.jpg │ ├── shaders2.jpg │ ├── theta.png │ └── trans │ ├── arccos.png │ ├── commutative.png │ ├── costheta.png │ ├── costheta2.png │ ├── k_black.png │ ├── k_green.png │ ├── n_unit.png │ ├── rxryrz.png │ ├── s1s2s3.png │ ├── s_blue.png │ ├── t1t2t3.png │ ├── transformations1.png │ ├── transformations10.png │ ├── transformations11.png │ ├── transformations12.png │ ├── transformations13.png │ ├── transformations14.png │ ├── transformations15.png │ ├── transformations16.png │ ├── transformations17.png │ ├── transformations18.png │ ├── transformations19.png │ ├── transformations2.png │ ├── transformations20.png │ ├── transformations21.png │ ├── transformations22.png │ ├── transformations23.png │ ├── transformations24.png │ ├── transformations25.png │ ├── transformations26.png │ ├── transformations27.png │ ├── transformations28.png │ ├── transformations29.png │ ├── transformations3.png │ ├── transformations30.png │ ├── transformations31.png │ ├── transformations32.png │ ├── transformations4.png │ ├── transformations5.png │ ├── transformations6.png │ ├── transformations7.png │ ├── transformations8.png │ ├── transformations9.png │ ├── v.k.png │ ├── v_black.png │ ├── v_mag.png │ ├── v_red.png │ ├── vxk.png │ ├── w_blue.png │ └── z_sq.png ├── setup.py ├── styleguide.md ├── tools ├── ClearBG.py └── README.md └── yeti ├── __init__.py ├── base.html ├── content.html ├── css ├── base.css ├── bootstrap-custom.min.css ├── font-awesome-4.0.3.css └── highlight.css ├── fonts ├── fontawesome-webfont.eot ├── fontawesome-webfont.svg ├── fontawesome-webfont.ttf └── fontawesome-webfont.woff ├── img └── favicon.ico ├── js ├── base.js ├── bootstrap-3.0.3.min.js ├── highlight.pack.js └── jquery-1.10.2.min.js ├── nav-sub.html ├── nav.html └── toc.html /.gitignore: -------------------------------------------------------------------------------- 1 | */._.* 2 | *.DS_Store 3 | /site 4 | /build 5 | *.data 6 | **/.Archive 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | 3 | python: 4 | - 3.4 5 | 6 | install: 7 | - pip install mkdocs 8 | - python setup.py install 9 | 10 | script: 11 | - mkdocs build --clean 12 | 13 | after_success: | 14 | if [ -n "$GITHUB_API_KEY" ]; then 15 | cd "$TRAVIS_BUILD_DIR" 16 | cd site 17 | git init 18 | git add . 19 | git -c user.name=$GITHUB_MEOWJ_NAME -c user.email=$GITHUB_MEOWJ_EMAIL commit -m "Auto Deployment" 20 | git push -f -q https://Meow-J:$GITHUB_API_KEY@github.com/LearnOpenGL-CN/learnopengl-cn.github.io master 21 | cd "$TRAVIS_BUILD_DIR" 22 | fi -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LearnOpenGL中文化工程 2 | 3 | [](https://travis-ci.org/LearnOpenGL-CN/LearnOpenGL-CN) 4 | 5 | learnopengl.com系列教程的中文翻译,目前正在翻译中。 6 | 7 | **英文原版**:[learnopengl.com](http://learnopengl.com/) 8 | 9 | **当前翻译进度**:52/63 10 | 11 | **校对进度**:13/48 12 | 13 | **目前状态**:请认领一下In Practice下的章节 14 | 15 | ## 阅读地址 16 | 17 | 目前Host在GitHub上,可以[点击这里](https://learnopengl-cn.github.io/)进行阅读。 18 | 19 | 旧版本的Host在Read The Docs内(不定时更新),可以[点击这里](http://learnopengl-cn.readthedocs.io/)进行阅读。 20 | 21 | ## 认领翻译 22 | 23 | 由于我们的志愿者来自五湖四海,为了避免冲突。请志愿者们先Clone这个Repository 。同步到本地后找到要翻译的文章,创建一个如下所示的只包含作者、翻译者和原文链接信息的Markdown文件: 24 | 25 | ``` 26 | 原文 | [英文标题](原文地址) 27 | ---|--- 28 | 作者 | JoeyDeVries 29 | 翻译 | [翻译] 30 | 校对 | 暂无 31 | ``` 32 | 33 | 译文的文件命名统一规范为: 34 | 35 | ``` 36 | <两位数的章序列> <章名称>/<两位数节序列> 节名称.md 37 | ``` 38 | 39 | 如果有小节的话: 40 | 41 | ``` 42 | <两位数的章序列> <章名称>/<两位数节序列> 节名称/<两位数小节序列> 小节名称.md 43 | ``` 44 | 45 | 例如: 46 | 47 | ``` 48 | 01 Getting started/01 OpenGL.md 49 | 或 50 | 05 Advanced Lighting/03 Shadows/02 Point Shadows.md 51 | ``` 52 | 53 | 之后请联系我们,将您加入LearnOpenGL-CN组织,然后提交并Push您的翻译。或者您也可以Fork这个工程在本地编辑之后发送Pull Request。 54 | 55 | ## 构建 56 | 57 | 首先请安装Python,2和3都可以,之后初始化环境: 58 | 59 | ```bash 60 | $ pip install mkdocs 61 | $ python setup.py install 62 | ``` 63 | 64 | 初始化以后,每次构建只需要输入以下指令即可,构建后的文件在`site`文件夹内: 65 | 66 | ```bash 67 | $ mkdocs build 68 | ``` 69 | 70 | 如果只是想测试的话,请输入以下指令: 71 | 72 | ```bash 73 | $ mkdocs serve 74 | ``` 75 | 76 | 部署的网页可以通过`127.0.0.1:8000`来访问。 77 | 78 | ## 建议 79 | 80 | 如果您发现教程有任何错误的话,欢迎Fork这个工程并发送Pull Request到 `new-theme` 分支。如果您不想修改的话,可以点击页面上方的 `Issues` 按钮提交一个Issue,我们看到后会及时更正。如果是对教程的内容有问题,请先查看原文,如果不是翻译错误的话,请直接在原网站评论区向作者(JoeyDeVries)反馈。 81 | 82 | ## 样式指南 83 | 84 | 在文档的写作过程中,请遵守我们的[样式指南](https://github.com/LearnOpenGL-CN/LearnOpenGL-CN/blob/new-theme/styleguide.md)方便之后的校对以及修改工作。 85 | 86 | ## 联系方式 87 | 88 | QQ群:383745868 -------------------------------------------------------------------------------- /docs/01 Getting started/01 OpenGL.md: -------------------------------------------------------------------------------- 1 | # OpenGL 2 | 3 | 原文 | [OpenGL](http://learnopengl.com/#!Getting-started/OpenGL) 4 | ---|--- 5 | 作者 | JoeyDeVries 6 | 翻译 | gjy_1992 7 | 校对 | Geequlim 8 | 9 | 10 | 在开始这段旅程之前我们先了解一下OpenGL到底是什么。一般它被认为是一个API(Application Programming Interface, 应用程序编程接口),包含了一系列可以操作图形、图像的函数。然而,OpenGL本身并不是一个API,它仅仅是一个由[Khronos组织](http://www.khronos.org/)制定并维护的规范(Specification)。 11 | 12 | 13 | 14 | OpenGL规范严格规定了每个函数该如何执行,以及它们的输出值。至于内部具体每个函数是如何实现(Implement)的,将由OpenGL库的开发者自行决定(注:这里开发者是指编写OpenGL库的人)。因为OpenGL规范并没有规定实现的细节,具体的OpenGL库允许使用不同的实现,只要其功能和结果与规范相匹配(亦即,作为用户不会感受到功能上的差异)。 15 | 16 | 实际的OpenGL库的开发者通常是显卡的生产商。你购买的显卡所支持的OpenGL版本都为这个系列的显卡专门开发的。当你使用Apple系统的时候,OpenGL库是由Apple自身维护的。在Linux下,有显卡生产商提供的OpenGL库,也有一些爱好者改编的版本。这也意味着任何时候OpenGL库表现的行为与规范规定的不一致时,基本都是库的开发者留下的bug。 17 | 18 | !!! important 19 | 20 | 由于OpenGL的大多数实现都是由显卡厂商编写的,当产生一个bug时通常可以通过升级显卡驱动来解决。这些驱动会包括你的显卡能支持的最新版本的OpenGL,这也是为什么总是建议你偶尔更新一下显卡驱动。 21 | 22 | 所有版本的OpenGL规范文档都被公开的寄存在Khronos那里。有兴趣的读者可以找到OpenGL3.3(我们将要使用的版本)的[规范文档](https://www.opengl.org/registry/doc/glspec33.core.20100311.withchanges.pdf)。如果你想深入到OpenGL的细节(只关心函数功能的描述而不是函数的实现),这是个很好的选择。如果你想知道每个函数**具体的**运作方式,这个规范也是一个很棒的参考。 23 | 24 | ## 核心模式与立即渲染模式 25 | 26 | 早期的OpenGL使用立即渲染模式(Immediate mode,也就是固定渲染管线),这个模式下绘制图形很方便。OpenGL的大多数功能都被库隐藏起来,开发者很少能控制OpenGL如何进行计算的自由。而开发者迫切希望能有更多的灵活性。随着时间推移,规范越来越灵活,开发者对绘图细节有了更多的掌控。立即渲染模式确实容易使用和理解,但是效率太低。因此从OpenGL3.2开始,规范文档开始废弃立即渲染模式,推出核心模式(Core-profile),这个模式完全移除了旧的特性。 27 | 28 | 当使用OpenGL的核心模式时,OpenGL迫使我们使用现代的函数。当我们试图使用一个已废弃的函数时,OpenGL会抛出一个错误并终止绘图。现代函数的优势是更高的灵活性和效率,然而也更难于学习。立即渲染模式从OpenGL**实际**运作中抽象掉了很多细节,因而它易于学习的同时,也很难去把握OpenGL具体是如何运作的。现代函数要求使用者真正理解OpenGL和图形编程,它有一些难度,然而提供了更多的灵活性,更高的效率,更重要的是可以更深入的理解图形编程。 29 | 30 | 这也是为什么我们的教程面向OpenGL3.3的核心模式。虽然上手更困难,但这份努力是值得的。 31 | 32 | 现今,更高版本的OpenGL已经发布(写作时最新版本为4.5),你可能会问:既然OpenGL 4.5 都出来了,为什么我们还要学习OpenGL 3.3?答案很简单,所有OpenGL的更高的版本都是在3.3的基础上,引入了额外的功能,并没有改动核心架构。新版本只是引入了一些更有效率或更有用的方式去完成同样的功能。因此,所有的概念和技术在现代OpenGL版本里都保持一致。当你的经验足够,你可以轻松使用来自更高版本OpenGL的新特性。 33 | 34 | !!! attention 35 | 36 | 当使用新版本的OpenGL特性时,只有新一代的显卡能够支持你的应用程序。这也是为什么大多数开发者基于较低版本的OpenGL编写程序,并只提供选项启用新版本的特性。 37 | 38 | 在有些教程里你会看见更现代的特性,它们同样会以这种红色注释方式标明。 39 | 40 | ## 扩展 41 | 42 | OpenGL的一大特性就是对扩展(Extension)的支持,当一个显卡公司提出一个新特性或者渲染上的大优化,通常会以扩展的方式在驱动中实现。如果一个程序在支持这个扩展的显卡上运行,开发者可以使用这个扩展提供的一些更先进更有效的图形功能。通过这种方式,开发者不必等待一个新的OpenGL规范面世,就可以使用这些新的渲染特性了,只需要简单地检查一下显卡是否支持此扩展。通常,当一个扩展非常流行或者非常有用的时候,它将最终成为未来的OpenGL规范的一部分。 43 | 44 | 使用扩展的代码大多看上去如下: 45 | 46 | ```c++ 47 | if(GL_ARB_extension_name) 48 | { 49 | // 使用一些新的特性 50 | } 51 | else 52 | { 53 | // 不支持此扩展: 用旧的方式去做 54 | } 55 | ``` 56 | 57 | 使用OpenGL3.3时,我们很少需要使用扩展来完成大多数功能,当需要的时候,本教程将提供适当的指示。 58 | 59 | ## 状态机 60 | 61 | OpenGL自身是一个巨大的状态机(State Machine):一系列的变量描述OpenGL此刻应当如何运行。OpenGL的状态通常被称为OpenGL上下文(Context)。我们通常使用如下途径去更改OpenGL状态:设置选项,操作缓冲。最后,我们使用当前OpenGL上下文来渲染。 62 | 63 | 假设当我们想告诉OpenGL去画线段而不是三角形的时候,我们通过改变一些上下文变量来改变OpenGL状态,从而告诉OpenGL如何去绘图。一旦我们改变了OpenGL的状态为绘制线段,下一个绘制命令就会画出线段而不是三角形。 64 | 65 | 当使用OpenGL的时候,我们会遇到一些状态设置函数(State-changing Function),这类函数将会改变上下文。以及状态应用函数(State-using Function),这类函数会根据当前OpenGL的状态执行一些操作。只要你记住OpenGL本质上是个大状态机,就能更容易理解它的大部分特性。 66 | 67 | ## 对象 68 | 69 | OpenGL库是用C语言写的,同时也支持多种语言的派生,但其内核仍是一个C库。由于C的一些语言结构不易被翻译到其它的高级语言,因此OpenGL开发的时候引入了一些抽象层。“对象(Object)”就是其中一个。 70 | 71 | 在OpenGL中一个对象是指一些选项的集合,它代表OpenGL状态的一个子集。比如,我们可以用一个对象来代表绘图窗口的设置,之后我们就可以设置它的大小、支持的颜色位数等等。可以把对象看做一个C风格的结构体(Struct): 72 | 73 | ```c++ 74 | struct object_name { 75 | GLfloat option1; 76 | GLuint option2; 77 | GLchar[] name; 78 | }; 79 | ``` 80 | 81 | !!! important 82 | 83 | **基元类型(Primitive Type)** 84 | 85 | 使用OpenGL时,建议使用OpenGL定义的基元类型。比如使用`float`时我们加上前缀`GL`(因此写作`GLfloat`)。`int`、`uint`、`char`、`bool`等等也类似。OpenGL定义的这些GL基元类型的内存布局是与平台无关的,而int等基元类型在不同操作系统上可能有不同的内存布局。使用GL基元类型可以保证你的程序在不同的平台上工作一致。 86 | 87 | 当我们使用一个对象时,通常看起来像如下一样(把OpenGL上下文看作一个大的结构体): 88 | 89 | ```c++ 90 | // OpenGL的状态 91 | struct OpenGL_Context 92 | { 93 | ... 94 | object* object_Window_Target; 95 | ... 96 | }; 97 | ``` 98 | 99 | ```c++ 100 | // 创建对象 101 | GLuint objectId = 0; 102 | glGenObject(1, &objectId); 103 | // 绑定对象至上下文 104 | glBindObject(GL_WINDOW_TARGET, objectId); 105 | // 设置当前绑定到 GL_WINDOW_TARGET 的对象的一些选项 106 | glSetObjectOption(GL_WINDOW_TARGET, GL_OPTION_WINDOW_WIDTH, 800); 107 | glSetObjectOption(GL_WINDOW_TARGET, GL_OPTION_WINDOW_HEIGHT, 600); 108 | // 将上下文对象设回默认 109 | glBindObject(GL_WINDOW_TARGET, 0); 110 | ``` 111 | 112 | 这一小段代码展现了你以后使用OpenGL时常见的工作流。我们首先创建一个对象,然后用一个id保存它的引用(实际数据被储存在后台)。然后我们将对象绑定至上下文的目标位置(例子中窗口对象目标的位置被定义成GL_WINDOW_TARGET)。接下来我们设置窗口的选项。最后我们将目标位置的对象id设回0,解绑这个对象。设置的选项将被保存在objectId所引用的对象中,一旦我们重新绑定这个对象到GL_WINDOW_TARGET位置,这些选项就会重新生效。 113 | 114 | !!! attention 115 | 116 | 目前提供的示例代码只是OpenGL如何操作的一个大致描述,通过阅读以后的教程你会遇到很多实际的例子。 117 | 118 | 使用对象的一个好处是在程序中,我们不止可以定义一个对象,并设置它们的选项,每个对象都可以是不同的设置。在我们执行一个使用OpenGL状态的操作的时候,只需要绑定含有需要的设置的对象即可。比如说我们有一些作为3D模型数据(一栋房子或一个人物)的容器对象,在我们想绘制其中任何一个模型的时候,只需绑定一个包含对应模型数据的对象就可以了(当然,我们需要先创建并设置对象的选项)。拥有数个这样的对象允许我们指定多个模型,在想画其中任何一个的时候,直接将对应的对象绑定上去,便不需要再重复设置选项了。 119 | 120 | ## 让我们开始吧 121 | 122 | 你现在已经知道一些OpenGL的相关知识了,OpenGL规范和库,OpenGL幕后大致的运作流程,以及OpenGL使用的一些传统技巧。不要担心你还没有完全消化它们,后面的教程我们会仔细地讲解每一个步骤,你会通过足够的例子来真正掌握OpenGL。如果你已经做好了开始下一步的准备,我们可以在[这里](02 Creating a window.md)开始创建OpenGL上下文以及我们的第一个窗口了。 123 | 124 | ## 附加资源 125 | 126 | - [opengl.org](https://www.opengl.org/):OpenGL官方网站。 127 | - [OpenGL registry](https://www.opengl.org/registry/):包含OpenGL各版本的规范和扩展。 -------------------------------------------------------------------------------- /docs/01 Getting started/10 Review.md: -------------------------------------------------------------------------------- 1 | # 复习 2 | 3 | 原文 | [Review](http://learnopengl.com/#!Getting-started/Review) 4 | ---|--- 5 | 作者 | JoeyDeVries 6 | 翻译 | Meow J 7 | 校对 | Geequlim 8 | 9 | 恭喜您完成了本章的学习,至此为止你应该能够创建一个窗口,创建并且编译着色器,通过缓冲对象或者uniform发送顶点数据,绘制物体,使用纹理,理解向量和矩阵,并且可以综合上述知识创建一个3D场景并可以通过摄像机来移动。 10 | 11 | 最后这几章我们学了太多的东西了。你可以尝试在教程的基础上改动程序,或者实验一下,有一点自己的想法并解决问题。一旦你认为你真正熟悉了我们讨论的所有的东西,你就可以进行[下一节](../02 Lighting/01 Colors.md)的学习。 12 | 13 | ## 词汇表 14 | 15 | - **OpenGL**: 一个定义了函数布局和输出的图形API的正式规范。 16 | - **GLEW**: 一个拓展加载库,用来为我们加载并设定所有OpenGL函数指针,从而让我们能够使用所有(现代)OpenGL函数。 17 | - **视口(Viewport)**: 我们需要渲染的窗口。 18 | - **图形管线(Graphics Pipeline)**: 一个顶点在呈现为像素之前通过的过程。 19 | - **着色器(Shader)**: 一个运行在显卡上的小型程序。很多阶段的图形管道都可以使用自定义的着色器来代替原来的功能。 20 | - **标准化设备坐标(Normalized Device Coordinates, NDC)**: 顶点在通过在剪裁坐标系中剪裁与透视划分后最终呈现在的坐标系。所有位置在NDC下-1.0到1.0的顶点将不会被丢弃并且可见。 21 | - **顶点缓冲对象(Vertex Buffer Object)**: 一个调用显存并存储所有顶点数据供显卡使用的缓冲对象。 22 | - **顶点数组对象(Vertex Array Object)**: 存储缓冲区和顶点属性状态。 23 | - **索引缓冲对象(Element Buffer Object)**: 一个存储索引供索引化绘制使用的缓冲对象。 24 | - **Uniform**: 一个特殊类型的GLSL变量。它是全局的(在一个着色器程序中每一个着色器都能够访问uniform变量),并且只能被设定一次。 25 | - **纹理(Texture)**: 一种缠绕物体的特殊类型图像,给物体精细的视觉效果。 26 | - **纹理缠绕(Texture Wrapping)**: 定义了一种当纹理顶点超出范围(0, 1)时指定OpenGL如何采样纹理的模式。 27 | - **纹理过滤(Texture Filtering)**: 定义了一种当有多种纹素选择时指定OpenGL如何采样纹理的模式。这通常在纹理被放大情况下发生。 28 | - **多级渐远纹理(Mipmaps)**: 被存储的材质的一些缩小版本,根据距观察者的距离会使用材质的合适大小。 29 | - **SOIL**: 图像加载库。 30 | - **纹理单元(Texture Units)**: 通过绑定纹理到不同纹理单元从而允许多个纹理在同一对象上渲染。 31 | - **向量(Vector)**: 一个定义了在空间中方向和/或位置的数学实体。 32 | - **矩阵(Matrix)**: 一个矩形阵列的数学表达式。 33 | - **GLM**: 一个为OpenGL打造的数学库。 34 | - **局部空间(Local Space)**: 一个物体的初始空间。所有的坐标都是相对于物体的原点的。 35 | - **世界空间(World Space)**: 所有的坐标都相对于全局原点。 36 | - **观察空间(View Space)**: 所有的坐标都是从摄像机的视角观察的。 37 | - **裁剪空间(Clip Space)**: 所有的坐标都是从摄像机视角观察的,但是该空间应用了投影。这个空间应该是一个顶点坐标最终的空间,作为顶点着色器的输出。OpenGL负责处理剩下的事情(裁剪/透视除法)。 38 | - **屏幕空间(Screen Space)**: 所有的坐标都由屏幕视角来观察。坐标的范围是从0到屏幕的宽/高。 39 | - **LookAt矩阵**: 一种特殊类型的观察矩阵,它创建了一个坐标系,其中所有坐标都根据从一个位置正在观察目标的用户旋转或者平移。 40 | - **欧拉角(Euler Angles)**: 被定义为偏航角(Yaw),俯仰角(Pitch),和滚转角(Roll)从而允许我们通过这三个值构造任何3D方向。 -------------------------------------------------------------------------------- /docs/02 Lighting/01 Colors.md: -------------------------------------------------------------------------------- 1 | # 颜色 2 | 3 | 原文 | [Colors](http://learnopengl.com/#!Lighting/Colors) 4 | ---|--- 5 | 作者 | JoeyDeVries 6 | 翻译 | [Geequlim](http://geequlim.com/) 7 | 校对 | [Geequlim](http://geequlim.com/) 8 | 9 | 在前面的教程中我们已经简要提到过该如何在OpenGL中使用颜色(Color),但是我们至今所接触到的都是很浅层的知识。本节我们将会更广泛地讨论颜色,并且还会为接下来的光照(Lighting)教程创建一个场景。 10 | 11 | 12 | 现实世界中有无数种颜色,每一个物体都有它们自己的颜色。我们要做的工作是使用(有限的)数字来模拟真实世界中(无限)的颜色,因此并不是所有的现实世界中的颜色都可以用数字来表示。然而我们依然可以用数字来代表许多种颜色,并且你甚至可能根本感觉不到他们与真实颜色之间的差异。颜色可以数字化的由红色(Red)、绿色(Green)和蓝色(Blue)三个分量组成,它们通常被缩写为RGB。这三个不同的分量组合在一起几乎可以表示存在的任何一种颜色。例如,要获取一个**珊瑚红(Coral)**颜色我们可以这样定义一个颜色向量: 13 | 14 | ```c++ 15 | glm::vec3 coral(1.0f, 0.5f, 0.31f); 16 | ``` 17 | 18 | 我们在现实生活中看到某一物体的颜色并不是这个物体的真实颜色,而是它所反射(Reflected)的颜色。换句话说,那些不能被物体吸收(Absorb)的颜色(被反射的颜色)就是我们能够感知到的物体的颜色。例如,太阳光被认为是由许多不同的颜色组合成的白色光(如下图所示)。如果我们将白光照在一个蓝色的玩具上,这个蓝色的玩具会吸收白光中除了蓝色以外的所有颜色,不被吸收的蓝色光被反射到我们的眼中,使我们看到了一个蓝色的玩具。下图显示的是一个珊瑚红的玩具,它以不同强度的方式反射了几种不同的颜色。 19 | 20 |  21 | 22 | 正如你所见,白色的阳光是一种所有可见颜色的集合,上面的物体吸收了其中的大部分颜色,它仅反射了那些代表这个物体颜色的部分,这些被反射颜色的组合就是我们感知到的颜色(此例中为珊瑚红)。 23 | 24 | 这些颜色反射的规律被直接地运用在图形领域。我们在OpenGL中创建一个光源时都会为它定义一个颜色。在前面的段落中所提到光源的颜色都是白色的,那我们就继续来创建一个白色的光源吧。当我们把光源的颜色与物体的颜色相乘,所得到的就是这个物体所反射该光源的颜色(也就是我们感知到的颜色)。让我们再次审视我们的玩具(这一次它还是珊瑚红)并看看如何计算出他的反射颜色。我们通过检索结果颜色的每一个分量来看一下光源色和物体颜色的反射运算: 25 | 26 | ```c++ 27 | glm::vec3 lightColor(1.0f, 1.0f, 1.0f); 28 | glm::vec3 toyColor(1.0f, 0.5f, 0.31f); 29 | glm::vec3 result = lightColor * toyColor; // = (1.0f, 0.5f, 0.31f); 30 | ``` 31 | 32 | 我们可以看到玩具在进行反射时**吸收**了白色光源颜色中的大部分颜色,但它对红、绿、蓝三个分量都有一定的反射,反射量是由物体本身的颜色所决定的。这也代表着现实中的光线原理。由此,我们可以定义物体的颜色为**这个物体从一个光源反射各个颜色分量的多少**。现在,如果我们使用一束绿色的光又会发生什么呢? 33 | 34 | ```c++ 35 | glm::vec3 lightColor(0.0f, 1.0f, 0.0f); 36 | glm::vec3 toyColor(1.0f, 0.5f, 0.31f); 37 | glm::vec3 result = lightColor * toyColor; // = (0.0f, 0.5f, 0.0f); 38 | ``` 39 | 40 | 可以看到,我们的玩具没有红色和蓝色的光让它来吸收或反射,这个玩具也吸收了光线中一半的绿色,当然它仍然反射了光的一半绿色。它现在看上去是深绿色(Dark-greenish)的。我们可以看到,如果我们用一束绿色的光线照来照射玩具,那么只有绿色能被反射和感知到,没有红色和蓝色能被反射和感知。这样做的结果是,一个珊瑚红的玩具突然变成了深绿色物体。现在我们来看另一个例子,使用深橄榄绿色(Dark olive-green)的光线: 41 | 42 | ```c++ 43 | glm::vec3 lightColor(0.33f, 0.42f, 0.18f); 44 | glm::vec3 toyColor(1.0f, 0.5f, 0.31f); 45 | glm::vec3 result = lightColor * toyColor; // = (0.33f, 0.21f, 0.06f); 46 | ``` 47 | 48 | 如你所见,我们可以通过物体对不同颜色光的反射来的得到意想不到的不到的颜色,从此创作颜色已经变得非常简单。 49 | 50 | 目前有了这些颜色相关的理论已经足够了,接下来我们将创建一个场景用来做更多的实验。 51 | 52 | # 创建一个光照场景 53 | 54 | 在接下来的教程中,我们将通过模拟真实世界中广泛存在的光照和颜色现象来创建有趣的视觉效果。现在我们将在场景中创建一个看得到的物体来代表光源,并且在场景中至少添加一个物体来模拟光照。 55 | 56 | 首先我们需要一个物体来投光(Cast the light),我们将无耻地使用前面教程中的立方体箱子。我们还需要一个物体来代表光源,它代表光源在这个3D空间中的确切位置。简单起见,我们依然使用一个立方体来代表光源(我们已拥有立方体的[顶点数据](http://www.learnopengl.com/code_viewer.php?code=getting-started/cube_vertices)是吧?)。 57 | 58 | 当然,填一个顶点缓冲对象(VBO),设定一下顶点属性指针和其他一些乱七八糟的东西现在对你来说应该很容易了,所以我们就不再赘述那些步骤了。如果你仍然觉得这很困难,我建议你复习[之前的教程](../01 Getting started/04 Hello Triangle.md),并且在继续学习之前先把练习过一遍。 59 | 60 | 所以,我们首先需要一个顶点着色器来绘制箱子。与上一个教程的顶点着色器相比,容器的顶点位置保持不变(虽然这一次我们不需要纹理坐标),因此顶点着色器中没有新的代码。我们将会使用上一篇教程顶点着色器的精简版: 61 | 62 | ```c++ 63 | #version 330 core 64 | layout (location = 0) in vec3 position; 65 | 66 | uniform mat4 model; 67 | uniform mat4 view; 68 | uniform mat4 projection; 69 | 70 | void main() 71 | { 72 | gl_Position = projection * view * model * vec4(position, 1.0f); 73 | } 74 | ``` 75 | 76 | 请确认更新你的顶点数据和属性对应的指针与新的顶点着色器一致(当然你可以继续保留纹理数据并保持属性对应的指针有效。在这一节中我们不使用纹理,但如果你想要一个全新的开始那也不是什么坏主意)。 77 | 78 | 因为我们还要创建一个表示灯(光源)的立方体,所以我们还要为这个灯创建一个特殊的VAO。当然我们也可以让这个灯和其他物体使用同一个VAO然后对他的`model`(模型)矩阵做一些变换,然而接下来的教程中我们会频繁地对顶点数据做一些改变并且需要改变属性对应指针设置,我们并不想因此影响到灯(我们只在乎灯的位置),因此我们有必要为灯创建一个新的VAO。 79 | 80 | ```c++ 81 | GLuint lightVAO; 82 | glGenVertexArrays(1, &lightVAO); 83 | glBindVertexArray(lightVAO); 84 | // 只需要绑定VBO不用再次设置VBO的数据,因为容器(物体)的VBO数据中已经包含了正确的立方体顶点数据 85 | glBindBuffer(GL_ARRAY_BUFFER, VBO); 86 | // 设置灯立方体的顶点属性指针(仅设置灯的顶点数据) 87 | glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(GLfloat), (GLvoid*)0); 88 | glEnableVertexAttribArray(0); 89 | glBindVertexArray(0); 90 | ``` 91 | 92 | 这段代码对你来说应该非常直观。既然我们已经创建了表示灯和被照物体的立方体,我们只需要再定义一个东西就行了了,那就是片段着色器 93 | 94 | ```c++ 95 | #version 330 core 96 | out vec4 color; 97 | 98 | uniform vec3 objectColor; 99 | uniform vec3 lightColor; 100 | 101 | void main() 102 | { 103 | color = vec4(lightColor * objectColor, 1.0f); 104 | } 105 | ``` 106 | 107 | 这个片段着色器接受两个分别表示物体颜色和光源颜色的uniform变量。正如本篇教程一开始所讨论的一样,我们将光源的颜色与物体(能反射)的颜色相乘。这个着色器应该很容易理解。接下来让我们把物体的颜色设置为上一节中所提到的珊瑚红并把光源设置为白色: 108 | 109 | ```c++ 110 | // 在此之前不要忘记首先'使用'对应的着色器程序(来设定uniform) 111 | GLint objectColorLoc = glGetUniformLocation(lightingShader.Program, "objectColor"); 112 | GLint lightColorLoc = glGetUniformLocation(lightingShader.Program, "lightColor"); 113 | glUniform3f(objectColorLoc, 1.0f, 0.5f, 0.31f);// 我们所熟悉的珊瑚红 114 | glUniform3f(lightColorLoc, 1.0f, 1.0f, 1.0f); // 依旧把光源设置为白色 115 | ``` 116 | 117 | 要注意的是,当我们修改顶点或者片段着色器后,灯的位置或颜色也会随之改变,这并不是我们想要的效果。我们不希望灯对象的颜色在接下来的教程中因光照计算的结果而受到影响,而希望它能够独立。希望表示灯不受其他光照的影响而一直保持明亮(这样它才更像是一个真实的光源)。 118 | 119 | 为了实现这个目的,我们需要为灯创建另外的一套着色器程序,从而能保证它能够在其他光照着色器变化的时候保持不变。顶点着色器和我们当前的顶点着色器是一样的,所以你可以直接把灯的顶点着色器复制过来。片段着色器保证了灯的颜色一直是亮的,我们通过给灯定义一个常量的白色来实现: 120 | 121 | ```c++ 122 | #version 330 core 123 | out vec4 color; 124 | 125 | void main() 126 | { 127 | color = vec4(1.0f); //设置四维向量的所有元素为 1.0f 128 | } 129 | ``` 130 | 131 | 当我们想要绘制我们的物体的时候,我们需要使用刚刚定义的光照着色器绘制箱子(或者可能是其它的一些物体),让我们想要绘制灯的时候,我们会使用灯的着色器。在之后的教程里我们会逐步升级这个光照着色器从而能够缓慢的实现更真实的效果。 132 | 133 | 使用这个灯立方体的主要目的是为了让我们知道光源在场景中的具体位置。我们通常在场景中定义一个光源的位置,但这只是一个位置,它并没有视觉意义。为了显示真正的灯,我们将表示光源的灯立方体绘制在与光源同样的位置。我们将使用我们为它新建的片段着色器让它保持它一直处于白色状态,不受场景中的光照影响。 134 | 135 | 我们声明一个全局`vec3`变量来表示光源在场景的世界空间坐标中的位置: 136 | 137 | ```c++ 138 | glm::vec3 lightPos(1.2f, 1.0f, 2.0f); 139 | ``` 140 | 141 | 然后我们把灯平移到这儿,当然我们需要对它进行缩放,让它不那么明显: 142 | 143 | ```c++ 144 | model = glm::mat4(); 145 | model = glm::translate(model, lightPos); 146 | model = glm::scale(model, glm::vec3(0.2f)); 147 | ``` 148 | 149 | 绘制灯立方体的代码应该与下面的类似: 150 | 151 | ```c++ 152 | lampShader.Use(); 153 | // 设置模型、视图和投影矩阵uniform 154 | ... 155 | // 绘制灯立方体对象 156 | glBindVertexArray(lightVAO); 157 | glDrawArrays(GL_TRIANGLES, 0, 36); 158 | glBindVertexArray(0); 159 | ``` 160 | 161 | 请把上述的所有代码片段放在你程序中合适的位置,这样我们就能有一个干净的光照实验场地了。如果一切顺利,运行效果将会如下图所示: 162 | 163 |  164 | 165 | 没什么好看的是吗?但我保证在接下来的教程中它会给你有趣的视觉效果。 166 | 167 | 如果你在把上述代码片段放到一起编译遇到困难,可以去认真地看看我的[源代码](http://learnopengl.com/code_viewer.php?code=lighting/colors_scene)。你好最自己实现一遍这些操作。 168 | 169 | 现在我们有了一些关于颜色的知识,并且创建了一个基本的场景能够绘制一些漂亮的光线。你现在可以阅读[下一节](02 Basic Lighting.md),真正的魔法即将开始! 170 | -------------------------------------------------------------------------------- /docs/02 Lighting/07 Review.md: -------------------------------------------------------------------------------- 1 | # 复习 2 | 3 | 原文 | [Review](http://learnopengl.com/#!Lighting/Review) 4 | ---|--- 5 | 作者 | JoeyDeVries 6 | 翻译 | Meow J 7 | 校对 | [Geequlim](http://geequlim.com) 8 | 9 | 恭喜您已经学习到了这个地方!辛苦啦!不知道你有没有注意到,总的来说我们在学习光照教程的时候学习的并不是OpenGL本身,当然我们仍然学习了一些细枝末节的知识(像访问uniform数组)。 10 | 11 | 到现在的所有教程都是关于用一些技巧和公式来操作着色器从而达到真实的光照效果。这同样向你展示了着色器的威力。 12 | 13 | 着色器是非常灵活的,你也亲眼见证了我们仅仅使用一些3D向量和可配置的变量就能够创造出惊人的图形这一点。 14 | 15 | 在你学过的最后几个教程中,你学习了有关颜色,冯氏光照模型(包括环境,漫反射,镜面反射光照),对象材质,可配置的光照属性,漫反射和镜面反射贴图,不同种类的光,并且学习了怎样将所有所学知识融会贯通。 16 | 17 | 记得去实验一下不同的光照,材质颜色,光照属性,并且试着利用你无穷的创造力创建自己的环境。 18 | 19 | 在[下一个教程](../03 Model Loading/01 Assimp.md)当中,我们将加入更高级的形状到我们的场景中,这些形状将会在我们之前讨论过的光照模型中非常好看。 20 | 21 | ## 词汇表 22 | 23 | - **颜色向量(Color Vector)**:一个通过红绿蓝(RGB)分量的组合描绘大部分真实颜色的向量。一个对象的颜色实际上是该对象不能吸收的反射颜色分量。 24 | - **冯氏光照模型(Phong Lighting Model)**:一个通过计算环境,漫反射,和镜面反射分量的值来估计真实光照的模型。 25 | - **环境光照(Ambient Lighting)**:通过给每个没有被光照的物体很小的亮度,使其不是完全黑暗的,从而对全局光照的估计。 26 | - **漫反射着色法(Diffuse Shading)**:光照随着更多的顶点/片段排列在光源上变强。该方法使用了法向量来计算角度。 27 | - **法向量(Normal Vector)**:一个垂直于平面的单位向量。 28 | - **正规矩阵(Normal Matrix)**:一个3x3矩阵, 或者说是没有平移的模型(或者模型观察)矩阵。它也被以某种方式修改(逆转置)从而当应用非统一缩放时保持法向量朝向正确的方向。否则法向量会在使用非统一缩放时失真。 29 | - **镜面光照(Specular Lighting)**:当观察者视线靠近光源在表面的反射线时会显示的镜面高光。镜面光照是由观察者的方向,光源的方向和设定高光分散量的反光度值三个量共同决定的。 30 | - **冯氏着色法(Phong Shading)**:冯氏光照模型应用在片段着色器。 31 | - **高氏着色法(Gouraud shading)**:冯氏光照模型应用在顶点着色器上。在使用很少数量的顶点时会产生明显的瑕疵。会得到效率提升但是损失了视觉质量。 32 | - **GLSL结构体(GLSL struct)**:一个类似于C的结构体,用作着色器变量的容器。大部分时间用来管理输入/输出/uniform。 33 | - **材质(Material)**:一个物体反射的环境,漫反射,镜面反射光照。这些东西设定了物体的颜色。 34 | - **光照(性质)(Light(properties))**:一个光的环境,漫反射,镜面反射的强度。可以应用任何颜色值并对每一个冯氏分量(Phong Component)都定义一个光源闪烁的颜色/强度。 35 | - **漫反射贴图(Diffuse Map)**:一个设定了每个片段中漫反射颜色的纹理图片。 36 | - **镜面贴图(Specular Map)**:一个设定了每一个片段的镜面强度/颜色的纹理贴图。仅在物体的特定区域允许镜面高光。 37 | - **平行光(Directional Light)**:只有一个方向的光源。它被建模为不管距离有多长所有光束都是平行而且其方向向量在整个场景中保持不变。 38 | - **点光源(Point Light)**:一个场景中光线逐渐淡出的光源。 39 | - **衰减(Attenuation)**:光减少强度的过程,通常使用在点光源和聚光下。 40 | - **聚光(Spotlight)**:一个被定义为在某一个方向上锥形的光源。 41 | - **手电筒(Flashlight)**:一个摆放在观察者视角的聚光。 42 | - **GLSL uniform数组(GLSL Uniform Array)**:一个uniform值数组。它的工作原理和C语言数组大致一样,只是不能动态分配内存。 -------------------------------------------------------------------------------- /docs/03 Model Loading/01 Assimp.md: -------------------------------------------------------------------------------- 1 | # Assimp 2 | 3 | 原文 | [Assimp](http://learnopengl.com/#!Model-Loading/Assimp) 4 | ---|--- 5 | 作者 | JoeyDeVries 6 | 翻译 | Cocoonshu 7 | 校对 | [Geequlim](http://geequlim.com) 8 | 9 | 10 | 到目前为止,我们已经在所有的场景中大面积滥用了我们的容器盒小盆友,但就是容器盒是我们的好朋友,时间久了我们也会喜新厌旧。一些图形应用里经常会使用很多复杂且好玩儿的模型,它们看起来比静态的容器盒可爱多了。但是,我们无法像定义容器盒一样手动地去指定房子、货车或人形角色这些复杂模型的顶点、法线和纹理坐标。我们需要做的也是应该要做的,是把这些模型导入到应用程序中,而设计制作这些3D模型的工作应该交给像[Blender](http://www.blender.org/)、[3DS Max](http://www.autodesk.nl/products/3ds-max/overview)或者[Maya](http://www.autodesk.com/products/autodesk-maya/overview)这样的工具软件。 11 | 12 | 那些3D建模工具,可以让美工们构建一些复杂的形状,并将贴图应用到形状上去,即纹理映射。然后,在导出模型文件时,建模工具会自己生成所有的顶点坐标、顶点法线和纹理坐标。这样,美工们可以不用了解大量的图像技术细节,就能有大量的工具集去随心地构建高品质的模型。所有的技术细节内容都隐藏在里导出的模型文件里。而我们,这些图形开发者,就必须得去关注这些技术细节了。 13 | 14 | 因此,我们的工作就是去解析这些导出的模型文件,并将其中的模型数据存储为OpenGL能够使用的数据。一个常见的问题是,导出的模型文件通常有几十种格式,不同的工具会根据不同的文件协议把模型数据导出到不同格式的模型文件中。有的模型文件格式只包含模型的静态形状数据和颜色、漫反射贴图、高光贴图这些基本的材质信息,比如Wavefront的.obj文件。而有的模型文件则采用XML来记录数据,且包含了丰富的模型、光照、各种材质、动画、摄像机信息和完整的场景信息等,比如Collada文件格式。Wavefront的obj格式是为了考虑到通用性而设计的一种便于解析的模型格式。建议去Wavefront的Wiki上看看obj文件格式是如何封装的。这会给你形成一个对模型文件格式的一个基本概念和印象。 15 | 16 | ## 模型加载库 17 | 18 | 现在市面上有一个很流行的模型加载库,叫做Assimp,全称为Open Asset Import Library。Assimp可以导入几十种不同格式的模型文件(同样也可以导出部分模型格式)。只要Assimp加载完了模型文件,我们就可以从Assimp上获取所有我们需要的模型数据。Assimp把不同的模型文件都转换为一个统一的数据结构,所有无论我们导入何种格式的模型文件,都可以用同一个方式去访问我们需要的模型数据。 19 | 20 | 当导入一个模型文件时,即Assimp加载一整个包含所有模型和场景数据的模型文件到一个scene对象时,Assimp会为这个模型文件中的所有场景节点、模型节点都生成一个具有对应关系的数据结构,且将这些场景中的各种元素与模型数据对应起来。下图展示了一个简化的Assimp生成的模型文件数据结构: 21 | 22 | 23 |  24 | 25 | 26 | - 所有的模型、场景数据都包含在scene对象中,如所有的材质和Mesh。同样,场景的根节点引用也包含在这个scene对象中 27 | - 场景的根节点可能也会包含很多子节点和一个指向保存模型点云数据mMeshes[]的索引集合。根节点上的mMeshes[]里保存了实际了Mesh对象,而每个子节点上的mMesshes[]都只是指向根节点中的mMeshes[]的一个引用(译者注:C/C++称为指针,Java/C#称为引用) 28 | - 一个Mesh对象本身包含渲染所需的所有相关数据,比如顶点位置、法线向量、纹理坐标、面片及物体的材质 29 | - 一个Mesh会包含多个面片。一个Face(面片)表示渲染中的一个最基本的形状单位,即图元(基本图元有点、线、三角面片、矩形面片)。一个面片记录了一个图元的顶点索引,通过这个索引,可以在mMeshes[]中寻找到对应的顶点位置数据。顶点数据和索引分开存放,可以便于我们使用缓存(VBO、NBO、TBO、IBO)来高速渲染物体。(详见[Hello Triangle](http://www.learnopengl.com/#!Getting-started/Hello-Triangle)) 30 | - 一个Mesh还会包含一个Material(材质)对象用于指定物体的一些材质属性。如颜色、纹理贴图(漫反射贴图、高光贴图等) 31 | 32 | 所以我们要做的第一件事,就是加载一个模型文件为scene对象,然后获取每个节点对应的Mesh对象(我们需要递归搜索每个节点的子节点来获取所有的节点),并处理每个Mesh对象对应的顶点数据、索引以及它的材质属性。最终我们得到一个只包含我们需要的数据的Mesh集合。 33 | 34 | !!! Important 35 | 36 | **网格(Mesh)** 37 | 38 | 用建模工具构建物体时,美工通常不会直接使用单个形状来构建一个完整的模型。一般来说,一个模型会由几个子模型/形状组合拼接而成。而模型中的那些子模型/形状就是我们所说的一个网格。例如一个人形模型,美工通常会把头、四肢、衣服、武器这些组件都分别构建出来,然后在把所有的组件拼合在一起,形成最终的完整模型。一个网格(包含顶点、索引和材质属性)是我们在OpenGL中绘制物体的最小单位。一个模型通常有多个网格组成。 39 | 40 | 下一节教程中,我们将用上述描述的数据结构来创建我们自己的Model类和Mesh类,用于加载和保存那些导入的模型。如果我们想要绘制一个模型,我们不会去渲染整个模型,而是去渲染这个模型所包含的所有独立的Mesh。不管怎样,我们开始导入模型之前,我们需要先把Assimp导入到我们的工程中。 41 | 42 | ## 构建Assimp 43 | 44 | 你可以在[Assimp的下载页面](http://assimp.sourceforge.net/main_downloads.html)选择一个想要的版本去下载Assimp库。到目前为止,Assimp可用的最新版本是3.1.1。我们建议你自己编译Assimp库,因为Assimp官方的已编译库不能很好地覆盖在所有平台上运行。如果你忘记怎样使用CMake编译一个库,请详见[Creating a window(创建一个窗口)](http://www.learnopengl.com/#!Getting-started/Creating-a-window)教程。 45 | 46 | 这里我们列出一些编译Assimp时可能遇到的问题,以便大家参考和排除: 47 | 48 | - CMake在读取配置列表时,报出与DirectX库丢失相关的一些错误。报错如下: 49 | 50 | ``` 51 | Could not locate DirecX 52 | CMake Error at cmake-modules/FindPkgMacros.cmake:110 (message): 53 | Required library DirectX not found! Install the library (including dev packages) and try again. If the library is already installed, set the missing variables manually in cmake. 54 | ``` 55 | 56 | 这个问题的解决方案:如果你之前没有安装过DirectX SDK,那么请安装。下载地址:[DirectX SDK](http://www.microsoft.com/en-us/download/details.aspx?id=6812)。 57 | 58 | - 安装DirectX SDK时,可能遇到一个错误码为S1023的错误。遇到这个问题,请在安装DirectX SDK前,先安装C++ Redistributable package(s)。 59 | 问题解释:[已知问题:DirectX SDK (June 2010) 安装及S1023错误](https://blogs.msdn.microsoft.com/chuckw/2011/12/09/known-issue-directx-sdk-june-2010-setup-and-the-s1023-error/)。 60 | 61 | - 一旦配置完成,你就可以生成解决方案文件了,打开解决方案文件并编译Assimp库(编译为Debug版本还是Release版本,根据你的需要和心情来定吧)。 62 | 63 | - 使用默认配置构建的Assimp是一个动态库,所以我们需要把编译出来的assimp.dll文件拷贝到我们自己程序的可执行文件的同一目录里。 64 | 65 | - 编译出来的Assimp的LIB文件和DLL文件可以在code/Debug或者code/Release里找到。 66 | 67 | - 把编译好的LIB文件和DLL文件拷贝到工程的相应目录下,并链接到你的解决方案中。同时还好记得把Assimp的头文件也拷贝到工程里去(Assimp的头文件可以在include目录里找到)。 68 | 69 | 如果你还遇到了其他问题,可以在下面给出的链接里获取帮助。 70 | 71 | !!! Important 72 | 73 | 如果你想要让Assimp使用多线程支持来提高性能,你可以使用Boost库来编译 Assimp。在[Boost安装页面](http://assimp.sourceforge.net/lib_html/install.html),你能找到关于Boost的完整安装介绍。 74 | 75 | 现在,你应该已经能够编译Assimp库,并链接Assimp到你的工程里去了。下一步:[导入完美的3D物件!](02 Mesh.md) 76 | -------------------------------------------------------------------------------- /docs/04 Advanced OpenGL/02 Stencil testing.md: -------------------------------------------------------------------------------- 1 | # 模板测试 2 | 3 | 原文 | [Stencil testing](http://learnopengl.com/#!Advanced-OpenGL/Stencil-testing) 4 | ---|--- 5 | 作者 | JoeyDeVries 6 | 翻译 | [Django](http://bullteacher.com/) 7 | 校对 | [Geequlim](http://geequlim.com) 8 | 9 | 当片段着色器处理完片段之后,**模板测试(Stencil Test)** 就开始执行了,和深度测试一样,它能丢弃一些片段。仍然保留下来的片段进入深度测试阶段,深度测试可能丢弃更多。模板测试基于另一个缓冲,这个缓冲叫做**模板缓冲(Stencil Buffer)**,我们被允许在渲染时更新它来获取有意思的效果。 10 | 11 | 模板缓冲中的**模板值(Stencil Value)**通常是8位的,因此每个片段/像素共有256种不同的模板值(译注:8位就是1字节大小,因此和char的容量一样是256个不同值)。这样我们就能将这些模板值设置为我们链接的,然后在模板测试时根据这个模板值,我们就可以决定丢弃或保留它了。 12 | 13 | !!! Important 14 | 15 | 每个窗口库都需要为你设置模板缓冲。GLFW自动做了这件事,所以你不必告诉GLFW去创建它,但是其他库可能没默认创建模板库,所以一定要查看你使用的库的文档。 16 | 17 | 下面是一个模板缓冲的简单例子: 18 | 19 |  20 | 21 | 模板缓冲先清空模板缓冲设置所有片段的模板值为0,然后开启矩形片段用1填充。场景中的模板值为1的那些片段才会被渲染(其他的都被丢弃)。 22 | 23 | 无论我们在渲染哪里的片段,模板缓冲操作都允许我们把模板缓冲设置为一个特定值。改变模板缓冲的内容实际上就是对模板缓冲进行写入。在同一次(或接下来的)渲染迭代我们可以读取这些值来决定丢弃还是保留这些片段。当使用模板缓冲的时候,你可以随心所欲,但是需要遵守下面的原则: 24 | 25 | * 开启模板缓冲写入。 26 | * 渲染物体,更新模板缓冲。 27 | * 关闭模板缓冲写入。 28 | * 渲染(其他)物体,这次基于模板缓冲内容丢弃特定片段。 29 | 30 | 使用模板缓冲我们可以基于场景中已经绘制的片段,来决定是否丢弃特定的片段。 31 | 32 | 你可以开启`GL_STENCIL_TEST`来开启模板测试。接着所有渲染函数调用都会以这样或那样的方式影响到模板缓冲。 33 | 34 | ```c++ 35 | glEnable(GL_STENCIL_TEST); 36 | ``` 37 | 要注意的是,像颜色和深度缓冲一样,在每次循环,你也得清空模板缓冲。 38 | 39 | ```c++ 40 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); 41 | ``` 42 | 43 | 同时,和深度测试的`glDepthMask`函数一样,模板缓冲也有一个相似函数。`glStencilMask`允许我们给模板值设置一个**位遮罩(Bitmask)**,它与模板值进行按位与(AND)运算决定缓冲是否可写。默认设置的位遮罩都是1,这样就不会影响输出,但是如果我们设置为0x00,所有写入深度缓冲最后都是0。这和深度缓冲的`glDepthMask(GL_FALSE)`很类似: 44 | 45 | ```c++ 46 | 47 | // 0xFF == 0b11111111 48 | //此时,模板值与它进行按位与运算结果是模板值,模板缓冲可写 49 | glStencilMask(0xFF); 50 | 51 | // 0x00 == 0b00000000 == 0 52 | //此时,模板值与它进行按位与运算结果是0,模板缓冲不可写 53 | glStencilMask(0x00); 54 | ``` 55 | 56 | 大多数情况你的模板遮罩(stencil mask)写为0x00或0xFF就行,但是最好知道有一个选项可以自定义位遮罩。 57 | 58 | ## 模板函数 59 | 60 | 和深度测试一样,我们也有几个不同控制权,决定何时模板测试通过或失败以及它怎样影响模板缓冲。一共有两种函数可供我们使用去配置模板测试:`glStencilFunc`和`glStencilOp`。 61 | 62 | `void glStencilFunc(GLenum func, GLint ref, GLuint mask)`函数有三个参数: 63 | 64 | * **func**:设置模板测试操作。这个测试操作应用到已经储存的模板值和`glStencilFunc`的`ref`值上,可用的选项是:`GL_NEVER`、`GL_LEQUAL`、`GL_GREATER`、`GL_GEQUAL`、`GL_EQUAL`、`GL_NOTEQUAL`、`GL_ALWAYS`。它们的语义和深度缓冲的相似。 65 | * **ref**:指定模板测试的引用值。模板缓冲的内容会与这个值对比。 66 | * **mask**:指定一个遮罩,在模板测试对比引用值和储存的模板值前,对它们进行按位与(and)操作,初始设置为1。 67 | 68 | 在上面简单模板的例子里,方程应该设置为: 69 | 70 | ```c 71 | glStencilFunc(GL_EQUAL, 1, 0xFF) 72 | ``` 73 | 74 | 它会告诉OpenGL,无论何时,一个片段模板值等于(`GL_EQUAL`)引用值`1`,片段就能通过测试被绘制了,否则就会被丢弃。 75 | 76 | 但是`glStencilFunc`只描述了OpenGL对模板缓冲做什么,而不是描述我们如何更新缓冲。这就需要`glStencilOp`登场了。 77 | 78 | `void glStencilOp(GLenum sfail, GLenum dpfail, GLenum dppass)`函数包含三个选项,我们可以指定每个选项的动作: 79 | 80 | * **sfail**: 如果模板测试失败将采取的动作。 81 | * **dpfail**: 如果模板测试通过,但是深度测试失败时采取的动作。 82 | * **dppass**: 如果深度测试和模板测试都通过,将采取的动作。 83 | 84 | 每个选项都可以使用下列任何一个动作。 85 | 86 | 操作 | 描述 87 | ---|--- 88 | GL_KEEP | 保持现有的模板值 89 | GL_ZERO | 将模板值置为0 90 | GL_REPLACE | 将模板值设置为用`glStencilFunc`函数设置的**ref**值 91 | GL_INCR | 如果模板值不是最大值就将模板值+1 92 | GL_INCR_WRAP| 与`GL_INCR`一样将模板值+1,如果模板值已经是最大值则设为0 93 | GL_DECR | 如果模板值不是最小值就将模板值-1 94 | GL_DECR_WRAP| 与`GL_DECR`一样将模板值-1,如果模板值已经是最小值则设为最大值 95 | GL_INVERT | Bitwise inverts the current stencil buffer value. 96 | 97 | `glStencilOp`函数默认设置为 (GL_KEEP, GL_KEEP, GL_KEEP) ,所以任何测试的任何结果,模板缓冲都会保留它的值。默认行为不会更新模板缓冲,所以如果你想写入模板缓冲的话,你必须像任意选项指定至少一个不同的动作。 98 | 99 | 使用`glStencilFunc`和`glStencilOp`,我们就可以指定在什么时候以及我们打算怎么样去更新模板缓冲了,我们也可以指定何时让测试通过或不通过。什么时候片段会被抛弃。 100 | 101 | # 物体轮廓 102 | 103 | 看了前面的部分你未必能理解模板测试是如何工作的,所以我们会展示一个用模板测试实现的一个特别的和有用的功能,叫做**物体轮廓(Object Outlining)**。 104 | 105 |  106 | 107 | 物体轮廓就像它的名字所描述的那样,它能够给每个(或一个)物体创建一个有颜色的边。在策略游戏中当你打算选择一个单位的时候它特别有用。给物体加上轮廓的步骤如下: 108 | 109 | 1. 在绘制物体前,把模板方程设置为`GL_ALWAYS`,用1更新物体将被渲染的片段。 110 | 2. 渲染物体,写入模板缓冲。 111 | 3. 关闭模板写入和深度测试。 112 | 4. 每个物体放大一点点。 113 | 5. 使用一个不同的片段着色器用来输出一个纯颜色。 114 | 6. 再次绘制物体,但只是当它们的片段的模板值不为1时才进行。 115 | 7. 开启模板写入和深度测试。 116 | 117 | 这个过程将每个物体的片段模板缓冲设置为1,当我们绘制边框的时候,我们基本上绘制的是放大版本的物体的通过测试的地方,放大的版本绘制后物体就会有一个边。我们基本会使用模板缓冲丢弃所有的不是原来物体的片段的放大的版本内容。 118 | 119 | 我们先来创建一个非常基本的片段着色器,它输出一个边框颜色。我们简单地设置一个固定的颜色值,把这个着色器命名为shaderSingleColor: 120 | 121 | ```c++ 122 | void main() 123 | { 124 | outColor = vec4(0.04, 0.28, 0.26, 1.0); 125 | } 126 | ``` 127 | 128 | 我们只打算给两个箱子加上边框,所以我们不会对地面做什么。这样我们要先绘制地面,然后再绘制两个箱子(同时写入模板缓冲),接着我们绘制放大的箱子(同时丢弃前面已经绘制的箱子的那部分片段)。 129 | 130 | 我们先开启模板测试,设置模板、深度测试通过或失败时才采取动作: 131 | 132 | ```c++ 133 | glEnable(GL_DEPTH_TEST); 134 | glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); 135 | ``` 136 | 137 | 如果任何测试失败我们都什么也不做,我们简单地保持深度缓冲中当前所储存着的值。如果模板测试和深度测试都成功了,我们就将储存着的模板值替换为`1`,我们要用`glStencilFunc`来做这件事。 138 | 139 | 我们清空模板缓冲为0,为箱子的所有绘制的片段的模板缓冲更新为1: 140 | 141 | ```c++ 142 | glStencilFunc(GL_ALWAYS, 1, 0xFF); //所有片段都要写入模板缓冲 143 | glStencilMask(0xFF); // 设置模板缓冲为可写状态 144 | normalShader.Use(); 145 | DrawTwoContainers(); 146 | ``` 147 | 148 | 使用`GL_ALWAYS`模板测试函数,我们确保箱子的每个片段用模板值1更新模板缓冲。因为片段总会通过模板测试,在我们绘制它们的地方,模板缓冲用引用值更新。 149 | 150 | 现在箱子绘制之处,模板缓冲更新为1了,我们将要绘制放大的箱子,但是这次关闭模板缓冲的写入: 151 | 152 | ```c++ 153 | glStencilFunc(GL_NOTEQUAL, 1, 0xFF); 154 | glStencilMask(0x00); // 禁止修改模板缓冲 155 | glDisable(GL_DEPTH_TEST); 156 | shaderSingleColor.Use(); 157 | DrawTwoScaledUpContainers(); 158 | ``` 159 | 160 | 我们把模板方程设置为`GL_NOTEQUAL`,它保证我们只箱子上不等于1的部分,这样只绘制前面绘制的箱子外围的那部分。注意,我们也要关闭深度测试,这样放大的的箱子也就是边框才不会被地面覆盖。 161 | 162 | 做完之后还要保证再次开启深度缓冲。 163 | 164 | 场景中的物体边框的绘制方法最后看起来像这样: 165 | 166 | ```c++ 167 | glEnable(GL_DEPTH_TEST); 168 | glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); 169 | 170 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); 171 | 172 | glStencilMask(0x00); // 绘制地板时确保关闭模板缓冲的写入 173 | normalShader.Use(); 174 | DrawFloor() 175 | 176 | glStencilFunc(GL_ALWAYS, 1, 0xFF); 177 | glStencilMask(0xFF); 178 | DrawTwoContainers(); 179 | 180 | glStencilFunc(GL_NOTEQUAL, 1, 0xFF); 181 | glStencilMask(0x00); 182 | glDisable(GL_DEPTH_TEST); 183 | shaderSingleColor.Use(); 184 | DrawTwoScaledUpContainers(); 185 | glStencilMask(0xFF); 186 | glEnable(GL_DEPTH_TEST); 187 | ``` 188 | 189 | 理解这段代码后面的模板测试的思路并不难以理解。如果还不明白尝试再仔细阅读上面的部分,尝试理解每个函数的作用,现在你已经看到了它的使用方法的例子。 190 | 191 | 这个边框的算法的结果在深度测试教程的那个场景中,看起来像这样: 192 | 193 |  194 | 195 | 在这里[查看源码](http://learnopengl.com/code_viewer.php?code=advanced/stencil_testing)和[着色器](http://learnopengl.com/code_viewer.php?code=advanced/depth_testing_func_shaders),看看完整的物体边框算法是怎样的。 196 | 197 | !!! Important 198 | 199 | 你可以看到两个箱子边框重合通常正是我们希望得到的(想想策略游戏中,我们打算选择10个单位;我们通常会希望把边界合并)。如果你想要让每个物体都有自己的边界那么你需要为每个物体清空模板缓冲,创造性地使用深度缓冲。 200 | 201 | 你目前看到的物体边框算法在一些游戏中显示备选物体(想象策略游戏)非常常用,这样的算法可以在一个模型类中轻易实现。你可以简单地在模型类设置一个布尔类型的标识来决定是否绘制边框。如果你想要更多的创造性,你可以使用后处理(post-processing)过滤比如高斯模糊来使边框看起来更自然。 202 | 203 | 除了物体边框以外,模板测试还有很多其他的应用目的,比如在后视镜中绘制纹理,这样它会很好的适合镜子的形状,比如使用一种叫做shadow volumes的模板缓冲技术渲染实时阴影。模板缓冲在我们的已扩展的OpenGL工具箱中给我们提供了另一种好用工具。 -------------------------------------------------------------------------------- /docs/04 Advanced OpenGL/04 Face culling.md: -------------------------------------------------------------------------------- 1 | # 面剔除 2 | 3 | 原文 | [Face culling](http://learnopengl.com/#!Advanced-OpenGL/Face-culling) 4 | ---|--- 5 | 作者 | JoeyDeVries 6 | 翻译 | [Django](http://bullteacher.com/) 7 | 校对 | [Geequlim](http://geequlim.com) 8 | 9 | 尝试在头脑中想象一下有一个3D立方体,你从任何一个方向去看它,最多可以同时看到多少个面。如果你的想象力不是过于丰富,你最终最多能数出来的面是3个。你可以从一个立方体的任意位置和方向上去看它,但是你永远不能看到多于3个面。所以我们为何还要去绘制那三个不会显示出来的3个面呢。如果我们可以以某种方式丢弃它们,我们会提高片段着色器超过50%的性能! 10 | 11 | !!! Important 12 | 13 | 我们所说的是超过50%而不是50%,因为从一个角度只有2个或1个面能够被看到。这种情况下我们就能够提高50%以上性能了。 14 | 15 | 16 | 这的确是个好主意,但是有个问题需要解决:我们如何知道某个面在观察者的视野中不会出现呢?如果我们去想象任何封闭的几何平面,它们都有两面,一面面向用户,另一面背对用户。假如我们只渲染面向观察者的面会怎样? 17 | 18 | 这正是**面剔除**(Face culling)所要做的。OpenGL允许检查所有正面朝向(Front facing)观察者的面,并渲染它们,而丢弃所有背面朝向(Back facing)的面,这样就节约了我们很多片段着色器的命令(它们很昂贵!)。我们必须告诉OpenGL我们使用的哪个面是正面,哪个面是反面。OpenGL使用一种聪明的手段解决这个问题——分析顶点数据的连接顺序(Winding order)。 19 | 20 | 21 | ## 顶点连接顺序 22 | 23 | 当我们定义一系列的三角顶点时,我们会把它们定义为一个特定的连接顺序(Winding Order),它们可能是**顺时针**的或**逆时针**的。每个三角形由3个顶点组成,我们从三角形的中间去看,从而把这三个顶点指定一个连接顺序。 24 | 25 |  26 | 27 | 正如你所看到的那样,我们先定义了顶点1,接着我们定义顶点2或3,这个不同的选择决定了这个三角形的连接顺序。下面的代码展示出这点: 28 | 29 | ```c++ 30 | GLfloat vertices[] = { 31 | //顺时针 32 | vertices[0], // vertex 1 33 | vertices[1], // vertex 2 34 | vertices[2], // vertex 3 35 | // 逆时针 36 | vertices[0], // vertex 1 37 | vertices[2], // vertex 3 38 | vertices[1] // vertex 2 39 | }; 40 | ``` 41 | 42 | 每三个顶点都形成了一个包含着连接顺序的基本三角形。OpenGL使用这个信息在渲染你的基本图形的时候决定这个三角形是三角形的正面还是三角形的背面。默认情况下,**逆时针**的顶点连接顺序被定义为三角形的**正面**。 43 | 44 | 当定义你的顶点顺序时,你如果定义能够看到的一个三角形,那它一定是正面朝向的,所以你定义的三角形应该是逆时针的,就像你直接面向这个三角形。把所有的顶点指定成这样是件炫酷的事,实际的顶点连接顺序是在**光栅化**阶段(Rasterization stage)计算的,所以当顶点着色器已经运行后。顶点就能够在观察者的观察点被看到。 45 | 46 | 我们指定了它们以后,观察者面对的所有的三角形的顶点的连接顺序都是正确的,但是现在渲染的立方体另一面的三角形的顶点的连接顺序被反转。最终,我们所面对的三角形被视为正面朝向的三角形,后部的三角形被视为背面朝向的三角形。下图展示了这个效果: 47 | 48 |  49 | 50 | 在顶点数据中,我们定义的是两个逆时针顺序的三角形。然而,从观察者的方面看,后面的三角形是顺时针的,如果我们仍以1、2、3的顺序以观察者当面的视野看的话。即使我们以逆时针顺序定义后面的三角形,它现在还是变为顺时针。它正是我们打算剔除(丢弃)的不可见的面! 51 | 52 | 53 | 54 | ## 面剔除 55 | 56 | 在教程的开头,我们说过OpenGL可以丢弃背面朝向的三角形。现在我们知道了如何设置顶点的连接顺序,我们可以开始使用OpenGL默认关闭的面剔除选项了。 57 | 58 | 记住我们上一节所使用的立方体的定点数据不是以逆时针顺序定义的。所以我更新了顶点数据,好去反应为一个逆时针链接顺序,你可以[从这里复制它](http://learnopengl.com/code_viewer.php?code=advanced/faceculling_vertexdata)。把所有三角的顶点都定义为逆时针是一个很好的习惯。 59 | 60 | 开启OpenGL的`GL_CULL_FACE`选项就能开启面剔除功能: 61 | 62 | ```c++ 63 | glEnable(GL_CULL_FACE); 64 | ``` 65 | 66 | 从这儿以后,所有的不是正面朝向的面都会被丢弃(尝试飞入立方体看看,里面什么面都看不见了)。目前,在渲染片段上我们节约了超过50%的性能,但记住这只对像立方体这样的封闭形状有效。当我们绘制上个教程中那个草的时候,我们必须关闭面剔除,这是因为它的前、后面都必须是可见的。 67 | 68 | OpenGL允许我们改变剔除面的类型。要是我们剔除正面而不是背面会怎样?我们可以调用`glCullFace`来做这件事: 69 | 70 | ```c++ 71 | glCullFace(GL_BACK); 72 | ``` 73 | 74 | `glCullFace`函数有三个可用的选项: 75 | 76 | * GL_BACK:只剔除背面。 77 | * GL_FRONT:只剔除正面。 78 | * GL_FRONT_AND_BACK:剔除背面和正面。 79 | 80 | `glCullFace`的初始值是`GL_BACK`。另外,我们还可以告诉OpenGL使用顺时针而不是逆时针来表示正面,这通过glFrontFace来设置: 81 | 82 | ```c++ 83 | glFrontFace(GL_CCW); 84 | ``` 85 | 86 | 默认值是`GL_CCW`,它代表逆时针,`GL_CW`代表顺时针顺序。 87 | 88 | 我们可以做个小实验,告诉OpenGL现在顺时针代表正面: 89 | 90 | ```c++ 91 | glEnable(GL_CULL_FACE); 92 | glCullFace(GL_BACK); 93 | glFrontFace(GL_CW); 94 | ``` 95 | 96 | 最后的结果只有背面被渲染了: 97 | 98 |  99 | 100 | 要注意,你可以使用默认逆时针顺序剔除正面,来创建相同的效果: 101 | 102 | ```c 103 | glEnable(GL_CULL_FACE); 104 | glCullFace(GL_FRONT); 105 | ``` 106 | 107 | 正如你所看到的那样,面剔除是OpenGL提高效率的一个强大工具,它使应用节省运算。你必须跟踪下来哪个物体可以使用面剔除,哪些不能。 108 | 109 | ## 练习 110 | 111 | 你可以自己重新定义一个顺时针的顶点顺序,然后用顺时针作为正面把它渲染出来吗:[解决方案](http://learnopengl.com/code_viewer.php?code=advanced/faceculling-exercise1)。 112 | -------------------------------------------------------------------------------- /docs/04 Advanced OpenGL/07 Advanced Data.md: -------------------------------------------------------------------------------- 1 | # 高级数据 2 | 3 | 原文 | [Advanced Data](http://learnopengl.com/#!Advanced-OpenGL/Advanced-Data) 4 | ---|--- 5 | 作者 | JoeyDeVries 6 | 翻译 | [Django](http://bullteacher.com/) 7 | 校对 | [Geequlim](http://geequlim.com) 8 | 9 | 10 | 我们在OpenGL中大量使用缓冲来储存数据已经有一会儿了。有一些有趣的方式来操纵缓冲,也有一些有趣的方式通过纹理来向着色器传递大量数据。本教程中,我们会讨论一些更加有意思的缓冲函数,以及如何使用纹理对象来储存大量数据(教程中纹理部分还没写)。 11 | 12 | OpenGL中缓冲只是一块儿内存区域的对象,除此没有更多点的了。当把缓冲绑定到一个特定缓冲对象的时候,我们就给缓冲赋予了一个特殊的意义。当我们绑定到`GL_ARRAY_BUFFER`的时候,这个缓冲就是一个顶点数组缓冲,我们也可以简单地绑定到`GL_ELEMENT_ARRAY_BUFFER`。OpenGL内部为每个目标(target)储存一个缓冲,并基于目标来处理不同的缓冲。 13 | 14 | 到目前为止,我们使用`glBufferData`函数填充缓冲对象管理的内存,这个函数分配了一块内存空间,然后把数据存入其中。如果我们向它的`data`这个参数传递的是NULL,那么OpenGL只会帮我们分配内存,而不会填充它。如果我们先打算开辟一些内存,稍后回到这个缓冲一点一点的填充数据,有些时候会很有用。 15 | 16 | 我们还可以调用`glBufferSubData`函数填充特定区域的缓冲,而不是一次填充整个缓冲。这个函数需要一个缓冲目标(target),一个偏移量(offset),数据的大小以及数据本身作为参数。这个函数新的功能是我们可以给它一个偏移量(offset)来指定我们打算填充缓冲的位置与起始位置之间的偏移量。这样我们就可以插入/更新指定区域的缓冲内存空间了。一定要确保修改的缓冲要有足够的内存分配,所以在调用`glBufferSubData`之前,调用`glBufferData`是必须的。 17 | 18 | ```c++ 19 | glBufferSubData(GL_ARRAY_BUFFER, 24, sizeof(data), &data); // 范围: [24, 24 + sizeof(data)] 20 | ``` 21 | 22 | 把数据传进缓冲另一个方式是向缓冲内存请求一个指针,你自己直接把数据复制到缓冲中。调用`glMapBuffer`函数OpenGL会返回一个当前绑定缓冲的内存的地址,供我们操作: 23 | 24 | ```c++ 25 | float data[] = { 26 | 0.5f, 1.0f, -0.35f 27 | ... 28 | }; 29 | 30 | glBindBuffer(GL_ARRAY_BUFFER, buffer); 31 | // 获取当前绑定缓存buffer的内存地址 32 | void* ptr = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); 33 | // 向缓冲中写入数据 34 | memcpy(ptr, data, sizeof(data)); 35 | // 完成够别忘了告诉OpenGL我们不再需要它了 36 | glUnmapBuffer(GL_ARRAY_BUFFER); 37 | ``` 38 | 39 | 调用`glUnmapBuffer`函数可以告诉OpenGL我们已经用完指针了,OpenGL会知道你已经做完了。通过解映射(unmapping),指针会不再可用,如果OpenGL可以把你的数据映射到缓冲上,就会返回`GL_TRUE`。 40 | 41 | 把数据直接映射到缓冲上使用`glMapBuffer`很有用,因为不用把它储存在临时内存里。你可以从文件读取数据然后直接复制到缓冲的内存里。 42 | 43 | ## 分批处理顶点属性 44 | 45 | 使用`glVertexAttribPointer`函数可以指定缓冲内容的顶点数组的属性的布局(Layout)。我们已经知道,通过使用顶点属性指针我们可以交叉(Interleave)属性,也就是说我们可以把每个顶点的位置、法线、纹理坐标放在彼此挨着的地方。现在我们了解了更多的缓冲的内容,可以采取另一种方式了。 46 | 47 | 我们可以做的是把每种类型的属性的所有向量数据批量保存在一个布局,而不是交叉布局。与交叉布局123123123123不同,我们采取批量方式111122223333。 48 | 49 | 当从文件加载顶点数据时你通常获取一个位置数组,一个法线数组和一个纹理坐标数组。需要花点力气才能把它们结合为交叉数据。使用`glBufferSubData`可以简单的实现分批处理方式: 50 | 51 | ```c++ 52 | GLfloat positions[] = { ... }; 53 | GLfloat normals[] = { ... }; 54 | GLfloat tex[] = { ... }; 55 | // 填充缓冲 56 | glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(positions), &positions); 57 | glBufferSubData(GL_ARRAY_BUFFER, sizeof(positions), sizeof(normals), &normals); 58 | glBufferSubData(GL_ARRAY_BUFFER, sizeof(positions) + sizeof(normals), sizeof(tex), &tex); 59 | ``` 60 | 61 | 这样我们可以把属性数组当作一个整体直接传输给缓冲,不需要再处理它们了。我们还可以把它们结合为一个更大的数组然后使用`glBufferData`立即直接填充它,不过对于这项任务使用`glBufferSubData`是更好的选择。 62 | 63 | 我们还要更新顶点属性指针来反应这些改变: 64 | 65 | ```c++ 66 | glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(GLfloat), 0); 67 | glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(GLfloat), (GLvoid*)(sizeof(positions))); 68 | glVertexAttribPointer( 69 | 2, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(GLfloat), (GLvoid*)(sizeof(positions) + sizeof(normals))); 70 | ``` 71 | 72 | 注意,`stride`参数等于顶点属性的大小,由于同类型的属性是连续储存的,所以下一个顶点属性向量可以在它的后面3(或2)的元素那儿找到。 73 | 74 | 这是我们有了另一种设置和指定顶点属性的方式。使用哪个方式对OpenGL来说也不会有立竿见影的效果,这只是一种采用更加组织化的方式去设置顶点属性。选用哪种方式取决于你的偏好和应用类型。 75 | 76 | ## 复制缓冲 77 | 78 | 当你的缓冲被数据填充以后,你可能打算让其他缓冲能分享这些数据或者打算把缓冲的内容复制到另一个缓冲里。`glCopyBufferSubData`函数让我们能够相对容易地把一个缓冲的数据复制到另一个缓冲里。函数的原型是: 79 | 80 | ```c++ 81 | void glCopyBufferSubData(GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); 82 | ``` 83 | 84 | `readtarget`和`writetarget`参数是复制的来源和目的的缓冲目标。例如我们可以从一个`VERTEX_ARRAY_BUFFER`复制到一个`VERTEX_ELEMENT_ARRAY_BUFFER`,各自指定源和目的的缓冲目标。当前绑定到这些缓冲目标上的缓冲会被影响到。 85 | 86 | 但如果我们打算读写的两个缓冲都是顶点数组缓冲(`GL_VERTEX_ARRAY_BUFFER`)怎么办?我们不能用通一个缓冲作为操作的读取和写入目标次。出于这个理由,OpenGL给了我们另外两个缓冲目标叫做:`GL_COPY_READ_BUFFER`和`GL_COPY_WRITE_BUFFER`。这样我们就可以把我们选择的缓冲,用上面二者作为`readtarget`和`writetarget`的参数绑定到新的缓冲目标上了。 87 | 88 | 接着`glCopyBufferSubData`函数会从readoffset处读取的size大小的数据,写入到writetarget缓冲的writeoffset位置。下面是一个复制两个顶点数组缓冲的例子: 89 | 90 | ```c++ 91 | GLfloat vertexData[] = { ... }; 92 | glBindBuffer(GL_COPY_READ_BUFFER, vbo1); 93 | glBindBuffer(GL_COPY_WRITE_BUFFER, vbo2); 94 | glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, sizeof(vertexData)); 95 | ``` 96 | 97 | 我们也可以把`writetarget`缓冲绑定为新缓冲目标类型其中之一: 98 | 99 | ```c++ 100 | GLfloat vertexData[] = { ... }; 101 | glBindBuffer(GL_ARRAY_BUFFER, vbo1); 102 | glBindBuffer(GL_COPY_WRITE_BUFFER, vbo2); 103 | glCopyBufferSubData(GL_ARRAY_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, sizeof(vertexData)); 104 | ``` 105 | 106 | 有了这些额外的关于如何操纵缓冲的知识,我们已经可以以更有趣的方式来使用它们了。当你对OpenGL更熟悉,这些新缓冲方法就变得更有用。下个教程中我们会讨论unform缓冲对象,彼时我们会充分利用`glBufferSubData`。 -------------------------------------------------------------------------------- /docs/05 Advanced Lighting/01 Advanced Lighting.md: -------------------------------------------------------------------------------- 1 | # 高级光照 2 | 3 | 原文 | [Advanced Lighting](http://learnopengl.com/#!Advanced-Lighting/Advanced-Lighting) 4 | ---|--- 5 | 作者 | JoeyDeVries 6 | 翻译 | [Django](http://bullteacher.com/) 7 | 校对 | gjy_1992 8 | 9 | 在光照教程中,我们简单的介绍了Phong光照模型,它给我们的场景带来的基本的现实感。Phong模型看起来还不错,但本章我们把重点放在一些细微差别上。 10 | 11 | ## Blinn-Phong 12 | 13 | Phong光照很棒,而且性能较高,但是它的镜面反射在某些条件下会失效,特别是当发光值属性低的时候,对应一个非常大的粗糙的镜面区域。下面的图片展示了,当我们使用镜面的发光值为1.0时,一个带纹理地板的效果: 14 | 15 |  16 | 17 | 你可以看到,镜面区域边缘迅速减弱并截止。出现这个问题的原因是在视线向量和反射向量的角度不允许大于90度。如果大于90度的话,点乘的结果就会是负数,镜面的贡献成分就会变成0。你可能会想,这不是一个问题,因为大于90度时我们不应看到任何光,对吧? 18 | 19 | 错了,这只适用于漫散射部分,当法线和光源之间的角度大于90度时意味着光源在被照亮表面的下方,这样光的散射成分就会是0.0。然而,对于镜面光照,我们不会测量光源和法线之间的角度,而是测量视线和反射方向向量之间的。看看下面的两幅图: 20 | 21 |  22 | 23 | 现在看来问题就很明显了。左侧图片显示Phong反射的θ小于90度的情况。我们可以看到右侧图片视线和反射之间的角θ大于90度,这样镜面反射成分将会被消除。通常这也不是问题,因为视线方向距离反射方向很远,但如果我们使用一个数值较低的发光值参数的话,镜面半径就会足够大,以至于能够贡献一些镜面反射的成份了。在例子中,我们在角度大于90度时消除了这个贡献(如第一个图片所示)。 24 | 25 | 1977年James F. Blinn引入了Blinn-Phong着色,它扩展了我们目前所使用的Phong着色。Blinn-Phong模型很大程度上和Phong是相似的,不过它稍微改进了Phong模型,使之能够克服我们所讨论到的问题。它放弃使用反射向量,而是基于我们现在所说的一个叫做半程向量(halfway vector)的向量,这是个单位向量,它在视线方向和光线方向的中间。半程向量和表面法线向量越接近,镜面反射成份就越大。 26 | 27 |  28 | 29 | 当视线方向恰好与反射向量对称时,半程向量就与法线向量重合。这样观察者距离原来的反射方向越近,镜面反射的高光就会越强。 30 | 31 | 这里,你可以看到无论观察者往哪里看,半程向量和表面法线之间的夹角永远都不会超过90度(当然除了光源远远低于表面的情况)。这样会产生和Phong反射稍稍不同的结果,但这时看起来会更加可信,特别是发光值参数比较低的时候。Blinn-Phong着色模型也正是早期OpenGL固定函数输送管道(fixed function pipeline)所使用的着色模型。 32 | 33 | 得到半程向量很容易,我们将光的方向向量和视线向量相加,然后将结果归一化(normalize); 34 | 35 | $$ 36 | \(\bar{H} = \frac{\bar{L} + \bar{V}}{||\bar{L} + \bar{V}||}\) 37 | $$ 38 | 39 | 翻译成GLSL代码如下: 40 | 41 | ```c++ 42 | vec3 lightDir = normalize(lightPos - FragPos); 43 | vec3 viewDir = normalize(viewPos - FragPos); 44 | vec3 halfwayDir = normalize(lightDir + viewDir); 45 | ``` 46 | 47 | 实际的镜面反射的计算,就成为计算表面法线和半程向量的点乘,并对其结果进行约束(大于或等于0),然后获取它们之间角度的余弦,再添加上发光值参数: 48 | 49 | ```c++ 50 | float spec = pow(max(dot(normal, halfwayDir), 0.0), shininess); 51 | vec3 specular = lightColor * spec; 52 | ``` 53 | 54 | 除了我们刚刚讨论的,Blinn-Phong没有更多的内容了。Blinn-Phong和Phong的镜面反射唯一不同之处在于,现在我们要测量法线和半程向量之间的角度,而半程向量是视线方向和反射向量之间的夹角。 55 | 56 | !!! Important 57 | 58 | Blinn-Phong着色的一个附加好处是,它比Phong着色性能更高,因为我们不必计算更加复杂的反射向量了。 59 | 60 | 引入了半程向量来计算镜面反射后,我们再也不会遇到Phong着色的骤然截止问题了。下图展示了两种不同方式下发光值指数为0.5时镜面区域的不同效果: 61 | 62 |  63 | 64 | Phong和Blinn-Phong着色之间另一个细微差别是,半程向量和表面法线之间的角度经常会比视线和反射向量之间的夹角更小。结果就是,为了获得和Phong着色相似的效果,必须把发光值参数设置的大一点。通常的经验是将其设置为Phong着色的发光值参数的2至4倍。 65 | 66 | 下图是Phong指数为8.0和Blinn-Phong指数为32的时候,两种specular反射模型的对比: 67 | 68 |  69 | 70 | 你可以看到Blinn-Phong的镜面反射成分要比Phong锐利一些。这通常需要使用一点小技巧才能获得之前你所看到的Phong着色的效果,但Blinn-Phong着色的效果比默认的Phong着色通常更加真实一些。 71 | 72 | 这里我们用到了一个简单像素着色器,它可以在普通Phong反射和Blinn-Phong反射之间进行切换: 73 | 74 | ```c++ 75 | void main() 76 | { 77 | [...] 78 | float spec = 0.0; 79 | if(blinn) 80 | { 81 | vec3 halfwayDir = normalize(lightDir + viewDir); 82 | spec = pow(max(dot(normal, halfwayDir), 0.0), 16.0); 83 | } 84 | else 85 | { 86 | vec3 reflectDir = reflect(-lightDir, normal); 87 | spec = pow(max(dot(viewDir, reflectDir), 0.0), 8.0); 88 | } 89 | ``` 90 | 91 | 你可以在这里找到这个简单的[demo的源码](http://www.learnopengl.com/code_viewer.php?code=advanced-lighting/blinn_phong)以及[顶点](http://www.learnopengl.com/code_viewer.php?code=advanced-lighting/blinn_phong&type=vertex)和[片段](http://www.learnopengl.com/code_viewer.php?code=advanced-lighting/blinn_phong&type=fragment)着色器。按下b键,这个demo就会从Phong切换到Blinn-Phong光照,反之亦然。 92 | 93 | -------------------------------------------------------------------------------- /docs/05 Advanced Lighting/03 Shadows/03 CSM.md: -------------------------------------------------------------------------------- 1 | # CSM 2 | 3 | **未完成** 4 | 5 | 这篇教程暂时还没有完成,您可以经常来刷新看看是否有更新的进展。 6 | 7 | -------------------------------------------------------------------------------- /docs/06 In Practice/2D-Game/01 Breakout.md: -------------------------------------------------------------------------------- 1 | # Breakout 2 | 3 | 原文 | [Breakout](http://www.learnopengl.com/#!In-Practice/2D-Game/Breakout) 4 | ---|--- 5 | 作者 | JoeyDeVries 6 | 翻译 | HHz(qq:1158332489) 7 | 校对 | Meow J 8 | 9 | 看完前面的教程之后我们已经了解了非常多的OpenGL内部工作原理,并且我们已经能够用这些知识绘制一些复杂的图形。然而,除了之前的几个技术演示之外,我们还没有真正利用OpenGL开发一个实际应用。这篇教程为OpenGL 2D游戏制作系列教程的入门篇。这个系列教程将展示我们该如何将OpenGL应用到更大,更复杂的环境中。注意这个系列教程不一定会引入新的OpenGL概念,但会或多或少地向我们展示如何将所学的概念应用到更大的程序中去。 10 | 11 | 由于我们希望事情能够简单一点,我们会以别人开发过的一个2D街机游戏为基础,开发我们自己的2D游戏。这就是Breakout,一个于1976年发布的运行在Atari 2600主机上的经典2D游戏。游戏要求玩家通过操控一个挡板反弹小球,以破坏所有的砖块,而不能让小球到达屏幕底端。当玩家破坏了所有砖块的时候即为完成了游戏。 12 | 13 | 下面我们可以看到Breakout原本在Atari 2600上是什么样子的: 14 | 15 |  16 | 17 | 游戏有以下几个机制: 18 | 19 | - 玩家能够控制一个小挡板,它只能在屏幕范围内左右移动。 20 | - 球在屏幕上运动,每一次碰撞都会使球根据碰撞位置改变运动方向。对屏幕边框,砖块,挡板都需要有碰撞判定。 21 | - 当球运动到屏幕底部边界的时候,游戏结束或者玩家丧失一点生命值。 22 | - 球碰到砖块的时候,砖块会被破坏。 23 | - 当所有砖块都被破坏,玩家获胜。 24 | - 球的方向可以通过球碰撞在挡板上的位置(即到挡板中心的距离)来操控。 25 | 26 | 由于小球会不时通过缝隙到达砖墙的上方,它会在顶部边缘与砖块层的上边缘之间不断弹跳。小球会一直持续这种状态直到最终再次进入缝隙掉下来。这也是这个游戏名字的来源,小球必须要从缝隙中逃脱(Break out)出来。 27 | 28 | # OpenGL Breakout 29 | 30 | 我们将把这个经典的街机游戏作为我们之后要完全使用OpenGL实现的这个游戏的基础。这个版本的Breakout将会运行在显卡上,所以我们能够改进经典的Breakout游戏,给它加一些很棒的特性。 31 | 32 | 除了以上这些经典的机制,我们的Breakout还将拥有: 33 | 34 | - 你见过最棒的画质 35 | - 粒子系统 36 | - 高级文字渲染 37 | - 道具 38 | - 后期处理特效 39 | - 多个(可自定义的)关卡 40 | 41 | 为了引起大家的兴趣,你可以看看游戏完成之后的样子: 42 | 43 |  44 | 45 | 这些教程将会结合之前教程中的大量概念,并且会展示如何让它们以一个整体工作。所以,在你开始这个系列教程的学习之前,请至少完成[「入门」](../../01 Getting started/01 OpenGL.md)章节。 46 | 47 | 而且,有些教程会需求其它一些教程的概念(比如说在[「高级OpenGL」](../../04 Advanced OpenGL/05 Framebuffers.md)章节中的帧缓冲),所以当必要的时候我会列出需求的教程。 48 | 49 | 如果你已准备好开发这个游戏,可以开始[下一节](02 Setting up.md)的学习了。 -------------------------------------------------------------------------------- /docs/06 In Practice/2D-Game/02 Setting up.md: -------------------------------------------------------------------------------- 1 | # 准备工作 2 | 3 | 原文 | [Setting up](http://learnopengl.com/#!In-Practice/2D-Game/Setting-up) 4 | ---|--- 5 | 作者 | JoeyDeVries 6 | 翻译 | [ZMANT](https://github.com/Itanq) 7 | 校对 | Meow J 8 | 9 | 在开始真正写游戏机制之前,我们首先需要配置一个简单的框架,用来存放这个游戏,这个游戏将会用到几个第三方库,它们的大多数都已经在前面的教程中介绍过了。在需要用到新的库的时候,我会作出适当的介绍。 10 | 11 | 首先,我们定义一个所谓的超级(Uber)游戏类,它会包含所有相关的渲染和游戏代码。这个游戏类的主要作用是(简单)管理你的游戏代码,并与此同时将所有的窗口代码从游戏中解耦。这样子的话,你就可以把相同的类迁移到完全不同的窗口库(比如SDL或SFML)而不需要做太多的工作。 12 | 13 | !!! important 14 | 15 | 抽象并归纳游戏或图形代码至类与对象中有成千上万种方式。在这个系列教程中你所看到的仅是其中的一种。如果你觉得能有更好的方式进行实现,你可以尝试改进我的这个实现。 16 | 17 | 这个游戏类封装了一个初始化函数、一个更新函数、一个处理输入函数以及一个渲染函数: 18 | 19 | ```c++ 20 | class Game 21 | { 22 | public: 23 | // 游戏状态 24 | GameState State; 25 | GLboolean Keys[1024]; 26 | GLuint Width, Height; 27 | // 构造函数/析构函数 28 | Game(GLuint width, GLuint height); 29 | ~Game(); 30 | // 初始化游戏状态(加载所有的着色器/纹理/关卡) 31 | void Init(); 32 | // 游戏循环 33 | void ProcessInput(GLfloat dt); 34 | void Update(GLfloat dt); 35 | void Render(); 36 | }; 37 | ``` 38 | 39 | 这个类应该包含了所有在一个游戏类中会出现的东西。我们通过给定一个宽度和高度(对应于你玩游戏时的分辨率)来初始化这个游戏,并且使用Init函数来加载着色器、纹理并且初始化所有的游戏状态。我们可以通过调用ProcessInput函数,并使用存储在Keys数组里的数据来处理输入。并且在Update函数里面我们可以更新游戏设置状态(比如玩家/球的移动)。最后,我们还可以调用Render函数来对游戏进行渲染。注意,我们将运动逻辑与渲染逻辑分开了。 40 | 41 | 这个Game类同样了封装了一个叫做State的变量,它的类型是GameState,定义如下: 42 | 43 | ```c++ 44 | // 代表了游戏的当前状态 45 | enum GameState { 46 | GAME_ACTIVE, 47 | GAME_MENU, 48 | GAME_WIN 49 | }; 50 | ``` 51 | 52 | 这个类可以帮助我们跟踪游戏的当前状态。这样的话我们就可以根据当前游戏的状态来决定渲染和/或者处理不同的元素(Item)了(比如当我们在游戏菜单界面的时候就可能需要渲染和处理不同的元素了)。 53 | 54 | 目前为止,这个游戏类的函数还完全是空的,因为我们还没有写游戏的实际代码,但这里是`Game`类的[头文件](http://learnopengl.com/code_viewer.php?code=in-practice/breakout/game_setting-up.h)和[代码文件](http://learnopengl.com/code_viewer.php?code=in-practice/breakout/game_setting-up)。 55 | 56 | ## 工具类 57 | 58 | 因为我们正在开发一个大型应用,所以我们将不得不频繁地重用一些OpenGL的概念,比如纹理和着色器等。因此,为这两个元素创建一个更加易用的接口也是情理之中的事了,就像在我们前面教程中创建的那个着色器类一样。 59 | 60 | 着色器类会接受两个或三个(如果有几何着色器)字符串,并生成一个编译好的着色器(如果失败的话则生成错误信息)。这个着色器类也包含很多工具(Utility)函数来帮助快速设置uniform值。纹理类会接受一个字节(Byte)数组以及宽度和高度,并(根据设定的属性)生成一个2D纹理图像。同样,这个纹理类也会封装一些工具函数。 61 | 62 | 我们并不会深入讨论这些类的实现细节,因为学到这里你应该可以很容易地理解它们是如何工作的了。出于这个原因,你可以在下面找到它们的头文件和代码文件,都有详细的注释: 63 | 64 | - **着色器**:[头文件](http://learnopengl.com/code_viewer.php?code=in-practice/breakout/shader.h),[代码](http://learnopengl.com/code_viewer.php?code=in-practice/breakout/shader) 65 | - **纹理**:[头文件](http://learnopengl.com/code_viewer.php?code=in-practice/breakout/texture.h),[代码](http://learnopengl.com/code_viewer.php?code=in-practice/breakout/texture) 66 | 67 | 注意当前的纹理类仅是为2D纹理设计的,但你很容易就可以将其扩张至更多的纹理类型。 68 | 69 | ## 资源管理 70 | 71 | 尽管着色器与纹理类的函数本身就很棒了,它们仍需要有一个字节数组或一些字符串来调用它们。我们可以很容易将文件加载代码嵌入到它们自己的类中,但这稍微有点违反了单一功能原则(Single Responsibility Principle),即这两个类应当分别仅仅关注纹理或者着色器本身,而不是它们的文件加载机制。 72 | 73 | 出于这个原因,我们通常会用一个更加有组织的方法(译注:来实现文件的加载),就是创建一个所谓资源管理器的实体,专门加载游戏相关的资源。创建一个资源管理器有多种方法。在这个教程中我们选择使用一个单一实例(Singleton)的静态资源管理器,(由于它静态的本质)它在整个工程中都可以使用,它会封装所有的已加载资源以及一些相关的加载功能。 74 | 75 | 使用一个具有静态属性的单一实例类有很多优点也有很多缺点。它主要的缺点就是这样会损失OOP属性,并且丧失构造与析构的控制。不过,对于我们这种小项目来说是这些问题也是很容易处理的。 76 | 77 | 和其它类的文件一样,这个资源管理器的代码如下: 78 | 79 | - **资源管理器**:[头文件](http://learnopengl.com/code_viewer.php?code=in-practice/breakout/resource_manager.h),[代码](http://learnopengl.com/code_viewer.php?code=in-practice/breakout/resource_manager) 80 | 81 | 通过使用资源管理器,我们可以很容易地把着色器加载到程序里面: 82 | 83 | ```c++ 84 | Shader shader = ResourceManager::LoadShader("vertex.vs", "fragment.vs", nullptr, "test"); 85 | // 接下来使用它 86 | shader.Use(); 87 | // 或者 88 | ResourceManager::GetShader("test").Use(); 89 | ``` 90 | 91 | Game类、资源管理器类,以及很容易管理的Shader和Texture2D类一起组成了之后教程的基础,我们之后会广泛使用这些类来实现我们的Breakout游戏。 92 | 93 | ## 程序 94 | 95 | 我们仍然需要为这个游戏创建一个窗口并且设置一些OpenGL的初始状态。我们确保使用OpenGL的[面剔除](../../04 Advanced OpenGL/04 Face culling.md)功能和[混合](../../04 Advanced OpenGL/03 Blending.md)功能。我们不需要使用深度测试,因为这个游戏完全是2D的,所有顶点都有相同的z值,所以开启深度测试并没有什么用,反而可能造成深度冲突(Z-fighting)。 96 | 97 | 这个Breakout游戏的起始代码非常简单:我们用GLFW创建一个窗口,注册一些回调函数,创建一个Game对象,并将所有相关的信息都传到游戏类中。代码如下: 98 | 99 | - **程序**:[代码](http://learnopengl.com/code_viewer.php?code=in-practice/breakout/program) 100 | 101 | 运行这个代码,你应该能得到下面的输出: 102 | 103 |  104 | 105 | 现在我们已经为之后的教程构建了一个坚实的框架,我们将不断地拓展这个游戏类,封装新的功能。如果你准备好了,就可以开始[下一节](03 Rendering Sprites.md)的学习了。 -------------------------------------------------------------------------------- /docs/07 PBR/01 Theory.md: -------------------------------------------------------------------------------- 1 | # 理论 2 | 3 | **未完成** 4 | 5 | 这篇教程暂时还没有完成,您可以经常来刷新看看是否有更新的进展。 6 | 7 | -------------------------------------------------------------------------------- /docs/07 PBR/02 Lighting.md: -------------------------------------------------------------------------------- 1 | # 光照 2 | 3 | **未完成** 4 | 5 | 这篇教程暂时还没有完成,您可以经常来刷新看看是否有更新的进展。 6 | 7 | -------------------------------------------------------------------------------- /docs/07 PBR/03 IBL.md: -------------------------------------------------------------------------------- 1 | # IBL 2 | 3 | **未完成** 4 | 5 | 这篇教程暂时还没有完成,您可以经常来刷新看看是否有更新的进展。 6 | 7 | -------------------------------------------------------------------------------- /docs/css/admonition_fix.css: -------------------------------------------------------------------------------- 1 | .important .admonition-title, .attention .admonition-title { 2 | display: none; 3 | } 4 | 5 | .note .admonition-title { 6 | font-weight: bold; 7 | font-size: 16px; 8 | background: #6ab0de; 9 | color: #FFF; 10 | display: block; 11 | margin: -12px; 12 | margin-bottom: 10px !important; 13 | padding: 6px 12px; 14 | line-height: 1; 15 | } 16 | 17 | .admonition p{ 18 | margin: auto; 19 | } 20 | 21 | .important, .attention { 22 | display: block; 23 | margin: 20px; 24 | padding: 15px; 25 | color: #444; 26 | border-radius: 5px; 27 | } 28 | 29 | .important { 30 | background-color: #D8F5D8; 31 | border: 2px solid #AFDFAF; 32 | } 33 | 34 | .attention { 35 | background-color: #FFD2D2; 36 | border: 2px solid #E0B3B3; 37 | } 38 | 39 | .note { 40 | display: block; 41 | padding: 12px; 42 | margin: 20px; 43 | color: #444; 44 | border-radius: 5px; 45 | background-color: #E7F2FA; 46 | border: 2px solid #6AB0DE; 47 | } 48 | -------------------------------------------------------------------------------- /docs/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: "Microsoft Yahei", "Lato", "proxima-nova", "Helvetica Neue", Arial, sans-serif; 3 | } 4 | 5 | h1, h2, h3, h4, h5, h6 { 6 | margin-bottom: 15px; 7 | margin-top: 20px; 8 | } 9 | 10 | h1, h2 { 11 | margin-top: 25px; 12 | border-bottom: 1px solid #e1e4e5; 13 | padding-bottom: 15px; 14 | } 15 | 16 | .col-md-9 p { 17 | line-height: 180%; 18 | } 19 | 20 | .col-md-9 li { 21 | margin-bottom: 3px; 22 | line-height: 180%; 23 | } 24 | 25 | .col-md-9 pre { 26 | background-color: #f5f7ff; 27 | } 28 | 29 | table td, table th { 30 | font-size: 100% !important; 31 | } 32 | 33 | code { 34 | font-size: 100%; 35 | background: #F8F8F8; 36 | font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif; 37 | } 38 | 39 | p code { 40 | font-size: 80%; 41 | word-wrap: normal; 42 | } 43 | 44 | div.admonition code { 45 | display: inline-block; 46 | overflow-x: visible; 47 | line-height: 18px; 48 | color: #404040; 49 | } 50 | 51 | img { 52 | display: block; 53 | margin-left: auto; 54 | margin-right: auto; 55 | border-radius: 7px; 56 | border: 3px solid #dbdfe4; 57 | } 58 | 59 | img.clean { 60 | border: 0px; 61 | } 62 | 63 | img.left { 64 | float: left; 65 | margin: 10px; 66 | border: 2px solid #dbdfe4; 67 | border-radius: 3px; 68 | margin-right: 20px; 69 | } 70 | 71 | img.right { 72 | float: right; 73 | margin: 10px; 74 | margin-left: 20px; 75 | } 76 | 77 | img.small { 78 | width: 150px; 79 | height: auto; 80 | } 81 | 82 | img.medium { 83 | width: 300px; 84 | height: auto; 85 | } 86 | 87 | img.large { 88 | width: 500px; 89 | height: auto; 90 | } 91 | 92 | img.noborder { 93 | border: none; 94 | } 95 | 96 | video { 97 | display: block; 98 | margin-left: auto; 99 | margin-right: auto; 100 | } 101 | 102 | @media screen and (max-width: 800px) { 103 | p, ol, ul { 104 | text-align: left; 105 | } 106 | } 107 | 108 | .hljs-comment { 109 | font-style: normal; 110 | font-size: 90%; 111 | } 112 | 113 | a.nav-title { 114 | cursor: pointer; 115 | } 116 | 117 | def { 118 | color: green; 119 | } 120 | 121 | fun { 122 | font-family: "Courier New", Courier, monospace; 123 | color: #822; 124 | } 125 | 126 | var { 127 | font-style: normal; 128 | font-family: "Courier New", Courier, monospace; 129 | color: #227; 130 | } 131 | -------------------------------------------------------------------------------- /docs/img/01/01/opengl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/01/opengl.jpg -------------------------------------------------------------------------------- /docs/img/01/02/cmake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/02/cmake.png -------------------------------------------------------------------------------- /docs/img/01/02/glfw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/02/glfw.png -------------------------------------------------------------------------------- /docs/img/01/02/include_directories.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/02/include_directories.png -------------------------------------------------------------------------------- /docs/img/01/02/linker_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/02/linker_input.png -------------------------------------------------------------------------------- /docs/img/01/02/vc_directories.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/02/vc_directories.png -------------------------------------------------------------------------------- /docs/img/01/03/hellowindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/03/hellowindow.png -------------------------------------------------------------------------------- /docs/img/01/03/hellowindow2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/03/hellowindow2.png -------------------------------------------------------------------------------- /docs/img/01/04/hellotriangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/04/hellotriangle.png -------------------------------------------------------------------------------- /docs/img/01/04/hellotriangle2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/04/hellotriangle2.png -------------------------------------------------------------------------------- /docs/img/01/04/ndc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/04/ndc.png -------------------------------------------------------------------------------- /docs/img/01/04/pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/04/pipeline.png -------------------------------------------------------------------------------- /docs/img/01/04/vertex_array_objects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/04/vertex_array_objects.png -------------------------------------------------------------------------------- /docs/img/01/04/vertex_array_objects_ebo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/04/vertex_array_objects_ebo.png -------------------------------------------------------------------------------- /docs/img/01/04/vertex_attribute_pointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/04/vertex_attribute_pointer.png -------------------------------------------------------------------------------- /docs/img/01/05/shaders.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/05/shaders.mp4 -------------------------------------------------------------------------------- /docs/img/01/05/shaders.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/05/shaders.png -------------------------------------------------------------------------------- /docs/img/01/05/shaders3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/05/shaders3.png -------------------------------------------------------------------------------- /docs/img/01/05/vertex_attribute_pointer_interleaved.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/05/vertex_attribute_pointer_interleaved.png -------------------------------------------------------------------------------- /docs/img/01/06/awesomeface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/06/awesomeface.png -------------------------------------------------------------------------------- /docs/img/01/06/container.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/06/container.jpg -------------------------------------------------------------------------------- /docs/img/01/06/filter_linear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/06/filter_linear.png -------------------------------------------------------------------------------- /docs/img/01/06/filter_nearest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/06/filter_nearest.png -------------------------------------------------------------------------------- /docs/img/01/06/mipmaps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/06/mipmaps.png -------------------------------------------------------------------------------- /docs/img/01/06/tex_coords.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/06/tex_coords.png -------------------------------------------------------------------------------- /docs/img/01/06/texture_filtering.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/06/texture_filtering.png -------------------------------------------------------------------------------- /docs/img/01/06/texture_wrapping.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/06/texture_wrapping.png -------------------------------------------------------------------------------- /docs/img/01/06/textures.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/06/textures.png -------------------------------------------------------------------------------- /docs/img/01/06/textures2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/06/textures2.png -------------------------------------------------------------------------------- /docs/img/01/06/textures_combined.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/06/textures_combined.png -------------------------------------------------------------------------------- /docs/img/01/06/textures_combined2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/06/textures_combined2.png -------------------------------------------------------------------------------- /docs/img/01/06/textures_funky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/06/textures_funky.png -------------------------------------------------------------------------------- /docs/img/01/06/vertex_attribute_pointer_interleaved_textures.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/06/vertex_attribute_pointer_interleaved_textures.png -------------------------------------------------------------------------------- /docs/img/01/06/wall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/06/wall.jpg -------------------------------------------------------------------------------- /docs/img/01/07/glm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/07/glm.png -------------------------------------------------------------------------------- /docs/img/01/07/matrix_multiplication.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/07/matrix_multiplication.png -------------------------------------------------------------------------------- /docs/img/01/07/transformations.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/07/transformations.mp4 -------------------------------------------------------------------------------- /docs/img/01/07/transformations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/07/transformations.png -------------------------------------------------------------------------------- /docs/img/01/07/vectors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/07/vectors.png -------------------------------------------------------------------------------- /docs/img/01/07/vectors_addition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/07/vectors_addition.png -------------------------------------------------------------------------------- /docs/img/01/07/vectors_angle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/07/vectors_angle.png -------------------------------------------------------------------------------- /docs/img/01/07/vectors_crossproduct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/07/vectors_crossproduct.png -------------------------------------------------------------------------------- /docs/img/01/07/vectors_scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/07/vectors_scale.png -------------------------------------------------------------------------------- /docs/img/01/07/vectors_subtraction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/07/vectors_subtraction.png -------------------------------------------------------------------------------- /docs/img/01/07/vectors_triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/07/vectors_triangle.png -------------------------------------------------------------------------------- /docs/img/01/08/coordinate_system_depth.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/08/coordinate_system_depth.mp4 -------------------------------------------------------------------------------- /docs/img/01/08/coordinate_system_no_depth.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/08/coordinate_system_no_depth.mp4 -------------------------------------------------------------------------------- /docs/img/01/08/coordinate_systems.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/08/coordinate_systems.png -------------------------------------------------------------------------------- /docs/img/01/08/coordinate_systems_multiple_objects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/08/coordinate_systems_multiple_objects.png -------------------------------------------------------------------------------- /docs/img/01/08/coordinate_systems_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/08/coordinate_systems_result.png -------------------------------------------------------------------------------- /docs/img/01/08/coordinate_systems_right_handed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/08/coordinate_systems_right_handed.png -------------------------------------------------------------------------------- /docs/img/01/08/orthographic_frustum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/08/orthographic_frustum.png -------------------------------------------------------------------------------- /docs/img/01/08/perspective.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/08/perspective.png -------------------------------------------------------------------------------- /docs/img/01/08/perspective_frustum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/08/perspective_frustum.png -------------------------------------------------------------------------------- /docs/img/01/08/perspective_orthographic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/08/perspective_orthographic.png -------------------------------------------------------------------------------- /docs/img/01/09/camera_axes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/09/camera_axes.png -------------------------------------------------------------------------------- /docs/img/01/09/camera_circle.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/09/camera_circle.mp4 -------------------------------------------------------------------------------- /docs/img/01/09/camera_inside.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/09/camera_inside.mp4 -------------------------------------------------------------------------------- /docs/img/01/09/camera_mouse.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/09/camera_mouse.mp4 -------------------------------------------------------------------------------- /docs/img/01/09/camera_pitch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/09/camera_pitch.png -------------------------------------------------------------------------------- /docs/img/01/09/camera_pitch_yaw_roll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/09/camera_pitch_yaw_roll.png -------------------------------------------------------------------------------- /docs/img/01/09/camera_smooth.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/09/camera_smooth.mp4 -------------------------------------------------------------------------------- /docs/img/01/09/camera_triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/09/camera_triangle.png -------------------------------------------------------------------------------- /docs/img/01/09/camera_yaw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/01/09/camera_yaw.png -------------------------------------------------------------------------------- /docs/img/02/01/colors_scene.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/01/colors_scene.png -------------------------------------------------------------------------------- /docs/img/02/01/light_reflection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/01/light_reflection.png -------------------------------------------------------------------------------- /docs/img/02/02/ambient_lighting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/02/ambient_lighting.png -------------------------------------------------------------------------------- /docs/img/02/02/basic_lighting_diffuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/02/basic_lighting_diffuse.png -------------------------------------------------------------------------------- /docs/img/02/02/basic_lighting_gouruad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/02/basic_lighting_gouruad.png -------------------------------------------------------------------------------- /docs/img/02/02/basic_lighting_normal_transformation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/02/basic_lighting_normal_transformation.png -------------------------------------------------------------------------------- /docs/img/02/02/basic_lighting_phong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/02/basic_lighting_phong.png -------------------------------------------------------------------------------- /docs/img/02/02/basic_lighting_specular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/02/basic_lighting_specular.png -------------------------------------------------------------------------------- /docs/img/02/02/basic_lighting_specular_shininess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/02/basic_lighting_specular_shininess.png -------------------------------------------------------------------------------- /docs/img/02/02/basic_lighting_specular_theory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/02/basic_lighting_specular_theory.png -------------------------------------------------------------------------------- /docs/img/02/02/diffuse_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/02/diffuse_light.png -------------------------------------------------------------------------------- /docs/img/02/03/materials.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/03/materials.mp4 -------------------------------------------------------------------------------- /docs/img/02/03/materials_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/03/materials_light.png -------------------------------------------------------------------------------- /docs/img/02/03/materials_real_world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/03/materials_real_world.png -------------------------------------------------------------------------------- /docs/img/02/03/materials_with_material.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/03/materials_with_material.png -------------------------------------------------------------------------------- /docs/img/02/04/container2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/04/container2.png -------------------------------------------------------------------------------- /docs/img/02/04/container2_specular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/04/container2_specular.png -------------------------------------------------------------------------------- /docs/img/02/04/lighting_maps_exercise3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/04/lighting_maps_exercise3.png -------------------------------------------------------------------------------- /docs/img/02/04/lighting_maps_specular_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/04/lighting_maps_specular_color.png -------------------------------------------------------------------------------- /docs/img/02/04/materials_diffuse_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/04/materials_diffuse_map.png -------------------------------------------------------------------------------- /docs/img/02/04/materials_specular_map (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/04/materials_specular_map (1).png -------------------------------------------------------------------------------- /docs/img/02/04/materials_specular_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/04/materials_specular_map.png -------------------------------------------------------------------------------- /docs/img/02/04/matrix.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/04/matrix.jpg -------------------------------------------------------------------------------- /docs/img/02/05/attenuation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/05/attenuation.png -------------------------------------------------------------------------------- /docs/img/02/05/light_casters_cos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/05/light_casters_cos.png -------------------------------------------------------------------------------- /docs/img/02/05/light_casters_directional.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/05/light_casters_directional.png -------------------------------------------------------------------------------- /docs/img/02/05/light_casters_directional_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/05/light_casters_directional_light.png -------------------------------------------------------------------------------- /docs/img/02/05/light_casters_point.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/05/light_casters_point.png -------------------------------------------------------------------------------- /docs/img/02/05/light_casters_point_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/05/light_casters_point_light.png -------------------------------------------------------------------------------- /docs/img/02/05/light_casters_spotlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/05/light_casters_spotlight.png -------------------------------------------------------------------------------- /docs/img/02/05/light_casters_spotlight_angles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/05/light_casters_spotlight_angles.png -------------------------------------------------------------------------------- /docs/img/02/05/light_casters_spotlight_hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/05/light_casters_spotlight_hard.png -------------------------------------------------------------------------------- /docs/img/02/05/materials_diffuse_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/05/materials_diffuse_map.png -------------------------------------------------------------------------------- /docs/img/02/06/multiple_lights_atmospheres.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/06/multiple_lights_atmospheres.png -------------------------------------------------------------------------------- /docs/img/02/06/multiple_lights_combined.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/02/06/multiple_lights_combined.png -------------------------------------------------------------------------------- /docs/img/03/01/assimp_structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/03/01/assimp_structure.png -------------------------------------------------------------------------------- /docs/img/03/03/model_diffuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/03/03/model_diffuse.png -------------------------------------------------------------------------------- /docs/img/03/03/model_lighting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/03/03/model_lighting.png -------------------------------------------------------------------------------- /docs/img/04/01/depth_linear_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/01/depth_linear_graph.png -------------------------------------------------------------------------------- /docs/img/04/01/depth_non_linear_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/01/depth_non_linear_graph.png -------------------------------------------------------------------------------- /docs/img/04/01/depth_testing_func_always.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/01/depth_testing_func_always.png -------------------------------------------------------------------------------- /docs/img/04/01/depth_testing_func_less.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/01/depth_testing_func_less.png -------------------------------------------------------------------------------- /docs/img/04/01/depth_testing_visible_depth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/01/depth_testing_visible_depth.png -------------------------------------------------------------------------------- /docs/img/04/01/depth_testing_visible_linear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/01/depth_testing_visible_linear.png -------------------------------------------------------------------------------- /docs/img/04/01/depth_testing_z_fighting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/01/depth_testing_z_fighting.png -------------------------------------------------------------------------------- /docs/img/04/02/stencil_buffer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/02/stencil_buffer.png -------------------------------------------------------------------------------- /docs/img/04/02/stencil_object_outlining.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/02/stencil_object_outlining.png -------------------------------------------------------------------------------- /docs/img/04/02/stencil_scene_outlined.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/02/stencil_scene_outlined.png -------------------------------------------------------------------------------- /docs/img/04/03/blending_discard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/03/blending_discard.png -------------------------------------------------------------------------------- /docs/img/04/03/blending_equation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/03/blending_equation.png -------------------------------------------------------------------------------- /docs/img/04/03/blending_equation_mixed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/03/blending_equation_mixed.png -------------------------------------------------------------------------------- /docs/img/04/03/blending_incorrect_order.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/03/blending_incorrect_order.png -------------------------------------------------------------------------------- /docs/img/04/03/blending_no_discard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/03/blending_no_discard.png -------------------------------------------------------------------------------- /docs/img/04/03/blending_sorted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/03/blending_sorted.png -------------------------------------------------------------------------------- /docs/img/04/03/blending_transparency.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/03/blending_transparency.png -------------------------------------------------------------------------------- /docs/img/04/03/blending_transparent_window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/03/blending_transparent_window.png -------------------------------------------------------------------------------- /docs/img/04/03/grass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/03/grass.png -------------------------------------------------------------------------------- /docs/img/04/04/faceculling_frontback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/04/faceculling_frontback.png -------------------------------------------------------------------------------- /docs/img/04/04/faceculling_reverse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/04/faceculling_reverse.png -------------------------------------------------------------------------------- /docs/img/04/04/faceculling_windingorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/04/faceculling_windingorder.png -------------------------------------------------------------------------------- /docs/img/04/05/container.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/05/container.jpg -------------------------------------------------------------------------------- /docs/img/04/05/framebuffers_blur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/05/framebuffers_blur.png -------------------------------------------------------------------------------- /docs/img/04/05/framebuffers_edge_detection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/05/framebuffers_edge_detection.png -------------------------------------------------------------------------------- /docs/img/04/05/framebuffers_grayscale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/05/framebuffers_grayscale.png -------------------------------------------------------------------------------- /docs/img/04/05/framebuffers_inverse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/05/framebuffers_inverse.png -------------------------------------------------------------------------------- /docs/img/04/05/framebuffers_mirror.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/05/framebuffers_mirror.png -------------------------------------------------------------------------------- /docs/img/04/05/framebuffers_screen_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/05/framebuffers_screen_texture.png -------------------------------------------------------------------------------- /docs/img/04/05/framebuffers_sharpen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/05/framebuffers_sharpen.png -------------------------------------------------------------------------------- /docs/img/04/06/cubemaps_morrowind.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/06/cubemaps_morrowind.jpg -------------------------------------------------------------------------------- /docs/img/04/06/cubemaps_reflection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/06/cubemaps_reflection.png -------------------------------------------------------------------------------- /docs/img/04/06/cubemaps_reflection_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/06/cubemaps_reflection_map.png -------------------------------------------------------------------------------- /docs/img/04/06/cubemaps_reflection_nanosuit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/06/cubemaps_reflection_nanosuit.png -------------------------------------------------------------------------------- /docs/img/04/06/cubemaps_reflection_theory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/06/cubemaps_reflection_theory.png -------------------------------------------------------------------------------- /docs/img/04/06/cubemaps_refraction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/06/cubemaps_refraction.png -------------------------------------------------------------------------------- /docs/img/04/06/cubemaps_refraction_theory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/06/cubemaps_refraction_theory.png -------------------------------------------------------------------------------- /docs/img/04/06/cubemaps_sampling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/06/cubemaps_sampling.png -------------------------------------------------------------------------------- /docs/img/04/06/cubemaps_skybox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/06/cubemaps_skybox.png -------------------------------------------------------------------------------- /docs/img/04/06/cubemaps_skybox_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/06/cubemaps_skybox_result.png -------------------------------------------------------------------------------- /docs/img/04/06/nanosuit_reflection.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/06/nanosuit_reflection.zip -------------------------------------------------------------------------------- /docs/img/04/06/skybox.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/06/skybox.rar -------------------------------------------------------------------------------- /docs/img/04/08/advanced_glsl_binding_points.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/08/advanced_glsl_binding_points.png -------------------------------------------------------------------------------- /docs/img/04/08/advanced_glsl_fragcoord.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/08/advanced_glsl_fragcoord.png -------------------------------------------------------------------------------- /docs/img/04/08/advanced_glsl_frontfacing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/08/advanced_glsl_frontfacing.png -------------------------------------------------------------------------------- /docs/img/04/08/advanced_glsl_pointsize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/08/advanced_glsl_pointsize.png -------------------------------------------------------------------------------- /docs/img/04/08/advanced_glsl_uniform_buffer_objects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/08/advanced_glsl_uniform_buffer_objects.png -------------------------------------------------------------------------------- /docs/img/04/09/geometry_shader_explosion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/09/geometry_shader_explosion.png -------------------------------------------------------------------------------- /docs/img/04/09/geometry_shader_house.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/09/geometry_shader_house.png -------------------------------------------------------------------------------- /docs/img/04/09/geometry_shader_houses.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/09/geometry_shader_houses.png -------------------------------------------------------------------------------- /docs/img/04/09/geometry_shader_houses_colored.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/09/geometry_shader_houses_colored.png -------------------------------------------------------------------------------- /docs/img/04/09/geometry_shader_houses_snow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/09/geometry_shader_houses_snow.png -------------------------------------------------------------------------------- /docs/img/04/09/geometry_shader_line_strip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/09/geometry_shader_line_strip.png -------------------------------------------------------------------------------- /docs/img/04/09/geometry_shader_lines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/09/geometry_shader_lines.png -------------------------------------------------------------------------------- /docs/img/04/09/geometry_shader_normals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/09/geometry_shader_normals.png -------------------------------------------------------------------------------- /docs/img/04/09/geometry_shader_points.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/09/geometry_shader_points.png -------------------------------------------------------------------------------- /docs/img/04/09/geometry_shader_triangle_strip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/09/geometry_shader_triangle_strip.png -------------------------------------------------------------------------------- /docs/img/04/10/instancing_asteroids.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/10/instancing_asteroids.png -------------------------------------------------------------------------------- /docs/img/04/10/instancing_asteroids_quantity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/10/instancing_asteroids_quantity.png -------------------------------------------------------------------------------- /docs/img/04/10/instancing_quads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/10/instancing_quads.png -------------------------------------------------------------------------------- /docs/img/04/10/instancing_quads_arrays.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/10/instancing_quads_arrays.png -------------------------------------------------------------------------------- /docs/img/04/11/anti_aliasing_aliasing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/11/anti_aliasing_aliasing.png -------------------------------------------------------------------------------- /docs/img/04/11/anti_aliasing_multisampled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/11/anti_aliasing_multisampled.png -------------------------------------------------------------------------------- /docs/img/04/11/anti_aliasing_post_processing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/11/anti_aliasing_post_processing.png -------------------------------------------------------------------------------- /docs/img/04/11/anti_aliasing_rasterization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/11/anti_aliasing_rasterization.png -------------------------------------------------------------------------------- /docs/img/04/11/anti_aliasing_rasterization_filled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/11/anti_aliasing_rasterization_filled.png -------------------------------------------------------------------------------- /docs/img/04/11/anti_aliasing_rasterization_samples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/11/anti_aliasing_rasterization_samples.png -------------------------------------------------------------------------------- /docs/img/04/11/anti_aliasing_rasterization_samples_filled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/11/anti_aliasing_rasterization_samples_filled.png -------------------------------------------------------------------------------- /docs/img/04/11/anti_aliasing_sample_points.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/11/anti_aliasing_sample_points.png -------------------------------------------------------------------------------- /docs/img/04/11/anti_aliasing_zoomed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/04/11/anti_aliasing_zoomed.png -------------------------------------------------------------------------------- /docs/img/05/01/advanced_lighting_comparrison.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/01/advanced_lighting_comparrison.png -------------------------------------------------------------------------------- /docs/img/05/01/advanced_lighting_comparrison2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/01/advanced_lighting_comparrison2.png -------------------------------------------------------------------------------- /docs/img/05/01/advanced_lighting_halfway_vector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/01/advanced_lighting_halfway_vector.png -------------------------------------------------------------------------------- /docs/img/05/01/advanced_lighting_over_90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/01/advanced_lighting_over_90.png -------------------------------------------------------------------------------- /docs/img/05/01/advanced_lighting_phong_limit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/01/advanced_lighting_phong_limit.png -------------------------------------------------------------------------------- /docs/img/05/02/gamma_correction_attenuation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/02/gamma_correction_attenuation.png -------------------------------------------------------------------------------- /docs/img/05/02/gamma_correction_brightness.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/02/gamma_correction_brightness.png -------------------------------------------------------------------------------- /docs/img/05/02/gamma_correction_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/02/gamma_correction_example.png -------------------------------------------------------------------------------- /docs/img/05/02/gamma_correction_gamma_curves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/02/gamma_correction_gamma_curves.png -------------------------------------------------------------------------------- /docs/img/05/02/gamma_correction_srgbtextures.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/02/gamma_correction_srgbtextures.png -------------------------------------------------------------------------------- /docs/img/05/03/01/shadow_mapping_acne.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/01/shadow_mapping_acne.png -------------------------------------------------------------------------------- /docs/img/05/03/01/shadow_mapping_acne_bias.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/01/shadow_mapping_acne_bias.png -------------------------------------------------------------------------------- /docs/img/05/03/01/shadow_mapping_acne_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/01/shadow_mapping_acne_diagram.png -------------------------------------------------------------------------------- /docs/img/05/03/01/shadow_mapping_clamp_edge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/01/shadow_mapping_clamp_edge.png -------------------------------------------------------------------------------- /docs/img/05/03/01/shadow_mapping_culling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/01/shadow_mapping_culling.png -------------------------------------------------------------------------------- /docs/img/05/03/01/shadow_mapping_depth_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/01/shadow_mapping_depth_map.png -------------------------------------------------------------------------------- /docs/img/05/03/01/shadow_mapping_outside_frustum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/01/shadow_mapping_outside_frustum.png -------------------------------------------------------------------------------- /docs/img/05/03/01/shadow_mapping_over_sampling_fixed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/01/shadow_mapping_over_sampling_fixed.png -------------------------------------------------------------------------------- /docs/img/05/03/01/shadow_mapping_peter_panning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/01/shadow_mapping_peter_panning.png -------------------------------------------------------------------------------- /docs/img/05/03/01/shadow_mapping_projection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/01/shadow_mapping_projection.png -------------------------------------------------------------------------------- /docs/img/05/03/01/shadow_mapping_shadows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/01/shadow_mapping_shadows.png -------------------------------------------------------------------------------- /docs/img/05/03/01/shadow_mapping_soft_shadows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/01/shadow_mapping_soft_shadows.png -------------------------------------------------------------------------------- /docs/img/05/03/01/shadow_mapping_theory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/01/shadow_mapping_theory.png -------------------------------------------------------------------------------- /docs/img/05/03/01/shadow_mapping_theory_spaces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/01/shadow_mapping_theory_spaces.png -------------------------------------------------------------------------------- /docs/img/05/03/01/shadow_mapping_with_bias.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/01/shadow_mapping_with_bias.png -------------------------------------------------------------------------------- /docs/img/05/03/01/shadow_mapping_with_without.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/01/shadow_mapping_with_without.png -------------------------------------------------------------------------------- /docs/img/05/03/01/shadow_mapping_zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/01/shadow_mapping_zoom.png -------------------------------------------------------------------------------- /docs/img/05/03/02/point_shadows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/02/point_shadows.png -------------------------------------------------------------------------------- /docs/img/05/03/02/point_shadows_depth_cubemap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/02/point_shadows_depth_cubemap.png -------------------------------------------------------------------------------- /docs/img/05/03/02/point_shadows_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/02/point_shadows_diagram.png -------------------------------------------------------------------------------- /docs/img/05/03/02/point_shadows_soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/02/point_shadows_soft.png -------------------------------------------------------------------------------- /docs/img/05/03/02/point_shadows_soft_better.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/03/02/point_shadows_soft_better.png -------------------------------------------------------------------------------- /docs/img/05/04/normal_mapping_compare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/04/normal_mapping_compare.png -------------------------------------------------------------------------------- /docs/img/05/04/normal_mapping_comparison.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/04/normal_mapping_comparison.png -------------------------------------------------------------------------------- /docs/img/05/04/normal_mapping_complex_compare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/04/normal_mapping_complex_compare.png -------------------------------------------------------------------------------- /docs/img/05/04/normal_mapping_correct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/04/normal_mapping_correct.png -------------------------------------------------------------------------------- /docs/img/05/04/normal_mapping_correct_tangent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/04/normal_mapping_correct_tangent.png -------------------------------------------------------------------------------- /docs/img/05/04/normal_mapping_flat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/04/normal_mapping_flat.png -------------------------------------------------------------------------------- /docs/img/05/04/normal_mapping_ground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/04/normal_mapping_ground.png -------------------------------------------------------------------------------- /docs/img/05/04/normal_mapping_ground_normals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/04/normal_mapping_ground_normals.png -------------------------------------------------------------------------------- /docs/img/05/04/normal_mapping_normal_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/04/normal_mapping_normal_map.png -------------------------------------------------------------------------------- /docs/img/05/04/normal_mapping_surface_edges.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/04/normal_mapping_surface_edges.png -------------------------------------------------------------------------------- /docs/img/05/04/normal_mapping_surfaces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/04/normal_mapping_surfaces.png -------------------------------------------------------------------------------- /docs/img/05/04/normal_mapping_tbn_shown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/04/normal_mapping_tbn_shown.png -------------------------------------------------------------------------------- /docs/img/05/04/normal_mapping_tbn_vectors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/04/normal_mapping_tbn_vectors.png -------------------------------------------------------------------------------- /docs/img/05/05/parallax_mapping.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/05/parallax_mapping.png -------------------------------------------------------------------------------- /docs/img/05/05/parallax_mapping_depth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/05/parallax_mapping_depth.png -------------------------------------------------------------------------------- /docs/img/05/05/parallax_mapping_edge_fix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/05/parallax_mapping_edge_fix.png -------------------------------------------------------------------------------- /docs/img/05/05/parallax_mapping_height_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/05/parallax_mapping_height_map.png -------------------------------------------------------------------------------- /docs/img/05/05/parallax_mapping_incorrect_p.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/05/parallax_mapping_incorrect_p.png -------------------------------------------------------------------------------- /docs/img/05/05/parallax_mapping_issues.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/05/parallax_mapping_issues.png -------------------------------------------------------------------------------- /docs/img/05/05/parallax_mapping_parallax_occlusion_mapping.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/05/parallax_mapping_parallax_occlusion_mapping.png -------------------------------------------------------------------------------- /docs/img/05/05/parallax_mapping_parallax_occlusion_mapping_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/05/parallax_mapping_parallax_occlusion_mapping_diagram.png -------------------------------------------------------------------------------- /docs/img/05/05/parallax_mapping_plane_height.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/05/parallax_mapping_plane_height.png -------------------------------------------------------------------------------- /docs/img/05/05/parallax_mapping_plane_heightmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/05/parallax_mapping_plane_heightmap.png -------------------------------------------------------------------------------- /docs/img/05/05/parallax_mapping_scaled_height.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/05/parallax_mapping_scaled_height.png -------------------------------------------------------------------------------- /docs/img/05/05/parallax_mapping_steep_artifact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/05/parallax_mapping_steep_artifact.png -------------------------------------------------------------------------------- /docs/img/05/05/parallax_mapping_steep_parallax_mapping.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/05/parallax_mapping_steep_parallax_mapping.png -------------------------------------------------------------------------------- /docs/img/05/05/parallax_mapping_steep_parallax_mapping_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/05/parallax_mapping_steep_parallax_mapping_diagram.png -------------------------------------------------------------------------------- /docs/img/05/06/hdr_clamped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/06/hdr_clamped.png -------------------------------------------------------------------------------- /docs/img/05/06/hdr_direct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/06/hdr_direct.png -------------------------------------------------------------------------------- /docs/img/05/06/hdr_exposure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/06/hdr_exposure.png -------------------------------------------------------------------------------- /docs/img/05/06/hdr_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/06/hdr_image.png -------------------------------------------------------------------------------- /docs/img/05/06/hdr_reinhard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/06/hdr_reinhard.png -------------------------------------------------------------------------------- /docs/img/05/07/bloom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/07/bloom.png -------------------------------------------------------------------------------- /docs/img/05/07/bloom_attachments.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/07/bloom_attachments.png -------------------------------------------------------------------------------- /docs/img/05/07/bloom_blurred.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/07/bloom_blurred.png -------------------------------------------------------------------------------- /docs/img/05/07/bloom_blurred_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/07/bloom_blurred_large.png -------------------------------------------------------------------------------- /docs/img/05/07/bloom_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/07/bloom_example.png -------------------------------------------------------------------------------- /docs/img/05/07/bloom_extracted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/07/bloom_extracted.png -------------------------------------------------------------------------------- /docs/img/05/07/bloom_gaussian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/07/bloom_gaussian.png -------------------------------------------------------------------------------- /docs/img/05/07/bloom_gaussian_two_pass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/07/bloom_gaussian_two_pass.png -------------------------------------------------------------------------------- /docs/img/05/07/bloom_scene.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/07/bloom_scene.png -------------------------------------------------------------------------------- /docs/img/05/07/bloom_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/07/bloom_small.png -------------------------------------------------------------------------------- /docs/img/05/07/bloom_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/07/bloom_steps.png -------------------------------------------------------------------------------- /docs/img/05/08/deferred_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/08/deferred_example.png -------------------------------------------------------------------------------- /docs/img/05/08/deferred_g_buffer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/08/deferred_g_buffer.png -------------------------------------------------------------------------------- /docs/img/05/08/deferred_light_volume_rendered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/08/deferred_light_volume_rendered.png -------------------------------------------------------------------------------- /docs/img/05/08/deferred_lights_depth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/08/deferred_lights_depth.png -------------------------------------------------------------------------------- /docs/img/05/08/deferred_lights_no_depth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/08/deferred_lights_no_depth.png -------------------------------------------------------------------------------- /docs/img/05/08/deferred_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/08/deferred_overview.png -------------------------------------------------------------------------------- /docs/img/05/08/deferred_shading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/08/deferred_shading.png -------------------------------------------------------------------------------- /docs/img/05/09/ssao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/09/ssao.png -------------------------------------------------------------------------------- /docs/img/05/09/ssao_banding_noise.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/09/ssao_banding_noise.jpg -------------------------------------------------------------------------------- /docs/img/05/09/ssao_crysis.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/09/ssao_crysis.jpg -------------------------------------------------------------------------------- /docs/img/05/09/ssao_crysis_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/09/ssao_crysis_circle.png -------------------------------------------------------------------------------- /docs/img/05/09/ssao_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/09/ssao_example.png -------------------------------------------------------------------------------- /docs/img/05/09/ssao_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/09/ssao_final.png -------------------------------------------------------------------------------- /docs/img/05/09/ssao_hemisphere (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/09/ssao_hemisphere (1).png -------------------------------------------------------------------------------- /docs/img/05/09/ssao_hemisphere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/09/ssao_hemisphere.png -------------------------------------------------------------------------------- /docs/img/05/09/ssao_kernel_weight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/09/ssao_kernel_weight.png -------------------------------------------------------------------------------- /docs/img/05/09/ssao_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/09/ssao_overview.png -------------------------------------------------------------------------------- /docs/img/05/09/ssao_range_check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/09/ssao_range_check.png -------------------------------------------------------------------------------- /docs/img/05/09/ssao_smoothstep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/09/ssao_smoothstep.png -------------------------------------------------------------------------------- /docs/img/05/09/ssao_without_blur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/05/09/ssao_without_blur.png -------------------------------------------------------------------------------- /docs/img/06/01/debugging_debug_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/01/debugging_debug_output.png -------------------------------------------------------------------------------- /docs/img/06/01/debugging_debug_output_breakpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/01/debugging_debug_output_breakpoint.png -------------------------------------------------------------------------------- /docs/img/06/01/debugging_external_codexl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/01/debugging_external_codexl.png -------------------------------------------------------------------------------- /docs/img/06/01/debugging_external_gdebugger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/01/debugging_external_gdebugger.png -------------------------------------------------------------------------------- /docs/img/06/01/debugging_external_nsight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/01/debugging_external_nsight.png -------------------------------------------------------------------------------- /docs/img/06/01/debugging_external_renderdoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/01/debugging_external_renderdoc.png -------------------------------------------------------------------------------- /docs/img/06/01/debugging_fbo_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/01/debugging_fbo_output.png -------------------------------------------------------------------------------- /docs/img/06/01/debugging_glgeterror.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/01/debugging_glgeterror.png -------------------------------------------------------------------------------- /docs/img/06/01/debugging_glsl_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/01/debugging_glsl_output.png -------------------------------------------------------------------------------- /docs/img/06/01/debugging_glsl_reference_compiler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/01/debugging_glsl_reference_compiler.png -------------------------------------------------------------------------------- /docs/img/06/02/bitmapfont.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/02/bitmapfont.png -------------------------------------------------------------------------------- /docs/img/06/02/glyph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/02/glyph.png -------------------------------------------------------------------------------- /docs/img/06/02/glyph_offset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/02/glyph_offset.png -------------------------------------------------------------------------------- /docs/img/06/02/text_rendering.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/02/text_rendering.png -------------------------------------------------------------------------------- /docs/img/06/02/text_rendering_quads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/02/text_rendering_quads.png -------------------------------------------------------------------------------- /docs/img/06/Breakout/01/breakout2600.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/Breakout/01/breakout2600.png -------------------------------------------------------------------------------- /docs/img/06/Breakout/01/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/Breakout/01/cover.png -------------------------------------------------------------------------------- /docs/img/06/Breakout/02/setting-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/Breakout/02/setting-up.png -------------------------------------------------------------------------------- /docs/img/06/Breakout/03/awesomeface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/Breakout/03/awesomeface.png -------------------------------------------------------------------------------- /docs/img/06/Breakout/03/projection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/Breakout/03/projection.png -------------------------------------------------------------------------------- /docs/img/06/Breakout/03/rendering-sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/Breakout/03/rendering-sprites.png -------------------------------------------------------------------------------- /docs/img/06/Breakout/03/rotation-origin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/Breakout/03/rotation-origin.png -------------------------------------------------------------------------------- /docs/img/06/Breakout/06/particle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/Breakout/06/particle.png -------------------------------------------------------------------------------- /docs/img/06/Breakout/06/particles.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/Breakout/06/particles.mp4 -------------------------------------------------------------------------------- /docs/img/06/Breakout/06/particles_example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/06/Breakout/06/particles_example.jpg -------------------------------------------------------------------------------- /docs/img/README.md: -------------------------------------------------------------------------------- 1 | # 图片 2 | 3 | 这个目录中所有图片和文件仅为保持教程的完整性以及可用性。文件为[Joey de Vries](http://joeydevries.com/)所有。所有权利均保留。 4 | The images and files under this directory are here for integrity and accessibility purposes. All credit goes to [Joey de Vries](http://joeydevries.com/). All rights reserved. -------------------------------------------------------------------------------- /docs/img/development.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/development.png -------------------------------------------------------------------------------- /docs/img/index_image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/docs/img/index_image2.png -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # 欢迎来到OpenGL的世界 2 | 3 | 欢迎来到OpenGL的世界。这个工程只是我([JoeyDeVries](http://joeydevries.com/))的一次小小的尝试,希望能够建立起一个完善的OpenGL教学平台。无论你学习OpenGL是为了学业,找工作,或仅仅是因为兴趣,这个网站都将能够教会你**现代**(Core-profile) OpenGL的基础,中级,以及高级知识。LearnOpenGL的目标是使用易于理解的形式,使用清晰的例子,展现现代OpenGL的所有知识点,与此同时为以后的学习提供有用的参考。 4 | 5 | ## 为什么要阅读这些教程呢? 6 | 7 | 8 | 9 | 在互联网上,关于学习OpenGL的有成千上万的文档与资源,然而其中大部分的资源仅仅讨论了OpenGL的立即渲染模式(Immediate Mode,通常会说旧OpenGL),亦或是不完整,缺少适当的文档,或仅仅不适合你的口味。所以我的目标是提供一个既完整,又易懂的平台供人们学习。 10 | 11 | 如果你很享受那些提供手把手指导的教程,那些提供清晰例子的教程,和那些不会一下将你淹没在细节中的教程,我的这些教程很可能就会适合你。这些教程旨在让那些没有图形编程经验的人们能够理解,又让那些有经验的读者有阅读下去的兴趣。这些教程同样也讨论了一些常用的概念,只需要你再有一点创造力,就能将你的想法变成真正的3D程序。如果如果你觉得前面这些讲的都是你,欢迎继续阅读我的教程。 12 | 13 | ## 你将学会什么呢? 14 | 15 | 我这些教程的核心是现代OpenGL。学习(和使用)现代OpenGL需要用户对图形编程以及OpenGL的幕后运作有非常高的理解才能在编程中有很好的发挥。所以,我们会先讨论核心的图形概念,OpenGL怎样画像素到屏幕上,还有如何利用黑科技做出一些很酷的效果。 16 | 17 | 除了核心概念之外,我们将会讨论许多有用的技巧,它们都可以用在你的程序中,比如说在你的场景中移动,做出漂亮的光效,加载一些建模软件导出的一些自定义的模型,做一些很酷的后期处理技巧等。最后,我们也将会使用我们已学的知识从头开始做一个小游戏,让你真正体验一把图形编程的魅力。 18 | 19 | ## 关于中文翻译 20 | 21 | 这里是LearnOpenGL教程的中文翻译,英文版的地址为:[http://learnopengl.com/](http://learnopengl.com/) 22 | 23 | 由于翻译可能无法做到精确表达原文意思,我们推荐您在对问题有疑惑的时候去阅读一下英文版的教程。如果您对翻译有更好的建议,可以去我们的[GitHub工程](https://github.com/LearnOpenGL-CN/LearnOpenGL-CN)上提交Issue或者Pull Request。如果是对教程的内容有问题,请先查看原文,如果不是翻译错误的话,请直接在原网站评论区向作者(JoeyDeVries)反馈。 -------------------------------------------------------------------------------- /docs/intro.md: -------------------------------------------------------------------------------- 1 | # 简介 2 | 3 | 你到这里来可能是想学习计算机图形的工作原理,并且自己做一些很酷的东西。自己做东西是非常有趣的,同样也能给你带来对图形编程的兴趣。然而,在你开始学习旅程之前,有这么几点注意事项。 4 | 5 | ## 前置知识 6 | 7 | 由于OpenGL是一个图形API,并不是一个独立的平台,它需要一个编程语言来工作,在这里我们使用的是C++。所以,对C++的熟练掌握在学习这个教程中是必不可少的。当然,我仍将尝试解释大部分用到的概念,包括一些高级的C++话题,所以,你并不一定要是一个C++专家才能来学习。不过,请确保你至少应该能写个比 'Hello World' 复杂的程序。如果你对C++不是很熟悉,我推荐您学习一下[www.learncpp.com](http://www.learncpp.com/)上的免费教程。 8 | 9 | 除此之外,我们也将用到一些数学知识(线性代数、几何、三角学),同样我也会尝试解释所有的必备的数学概念。但是,毕竟我不是一个数学家,即使我的解释可能会很容易理解,但是这些解释都是不全面的。所以,在必须的时候我会链接一些不错的资料,它们会将这些概念解释的更加全面。不要被必须的数学知识吓到了,几乎所有的概念只要有基础的数学背景都可以理解。我也会将数学的内容压缩至极限。大部分的功能甚至都不需要你理解所有的数学知识,只要你会使用就行。 10 | 11 | ## 结构 12 | 13 | LearnOpenGL被分解成了许多大的主题。每个主题包括一些小节,每个小节中会对不同的概念进行详细的解释。所有的主题都可以在目录中找到。这些主题是按照线性来学习的(所以建议从上到下来读,除非有特殊指示),每个页面将会解释每个概念的背景理论和实际操作。 14 | 15 | 为了让教程更容易理解,结构更鲜明,本站采用了**方框**和**代码块**。 16 | 17 | ### 方框 18 | 19 | !!! important 20 | 21 | **绿色**方框是一些注释或者是对于OpenGL或讨论主题有用的特性/提示。 22 | 23 | !!! attention 24 | 25 | **红色**方框是一些警告或者一些你需要特别注意的特性。 26 | 27 | !!! note "译注" 28 | 29 | **蓝色**方框是翻译时为了帮助读者理解附加的一些信息。 30 | 31 | ### 代码 32 | 33 | 你在网站中将会看到很多小片的代码,它们将会在下面这样的代码框中: 34 | 35 | ```c++ 36 | // 这个方框是代码 37 | ``` 38 | 39 | 由于这样只提供了代码的片段,当需要的时候我会提供个链接到当前工程的源代码的。 40 | 41 | ### 颜色标记 42 | 43 | 有一些词语会以不同颜色显示出来,用来表示这些词语有不同的意义: 44 | 45 | - 定义:绿色的字是定义,即一个重要的概念或名称,这些词语你能经常见到。 46 | - 程序逻辑:红色的字是函数的名称或者是类名。 47 | - 变量:蓝色的字是变量,包括所有的OpenGL常量。 48 | 49 | 现在你应该对这个网站的结构有一些了解了,你现在可以进入「入门」这一章,开始你的OpenGL学习生涯吧! -------------------------------------------------------------------------------- /glossary.md: -------------------------------------------------------------------------------- 1 | # 专有词汇翻译记录 2 | 3 | 本文档收录了校对过程中翻译的所有专有词汇,供翻译统一化使用,每一节都只提供新出现的词汇。 4 | 5 | ## 01-01 6 | 7 | - API:Application Programming Interface,应用程序编程接口 8 | - Specification:规范 9 | - Implement:实现 10 | - Immediate mode:立即渲染模式 11 | - Core-profile:核心模式 12 | - Fixed Function Pipeline:固定渲染管线 13 | - Extension:扩展 14 | - State Machine:状态机 15 | - Context:上下文 16 | - State-changing Function:状态设置函数 17 | - State-using Function:状态应用函数 18 | - Object:对象 19 | - Primitive Type:基元类型 20 | - Option:选项 21 | - Modern:现代 22 | 23 | ## 01-02 24 | 25 | - Abstract:抽象 26 | - Link:链接 27 | - Linker:连接器 28 | - Dynamic:动态 29 | - Static:静态 30 | 31 | ## 01-03 32 | 33 | - Major:主版本号 34 | - Minor:次版本号 35 | - Viewport:视口 36 | - Dimension(窗口):维度 37 | - Game Loop:游戏循环 38 | - Color Buffer:颜色缓冲 39 | - Double Buffer:双缓冲 40 | - Front Buffer:前缓冲 41 | - Back Buffer:后缓冲 42 | - Swap:交换 43 | - Callback Function:回调函数 44 | - KeyCallback:按键回调 45 | - Callback:回调 46 | - Rendering:渲染 47 | - Call:调用 48 | 49 | ## 01-04 50 | 51 | - Graphics Pipeline:图形渲染管线 52 | - Resolution(图像,屏幕):分辨率 53 | - Shader:着色器 54 | - GLSL:OpenGL Shading Language,OpenGL着色器语言 55 | - Vertex Data:顶点数据 56 | - Vertex:顶点 57 | - Vertex Attribute:顶点属性 58 | - Primitive:图元 59 | - Vertex Shader:顶点着色器 60 | - Primitive Assembly:图元装配 61 | - Rasterization:光栅化 62 | - Fragment:片段 63 | - Fragment Shader:片段着色器 64 | - View:视图 65 | - Alpha Test:Alpha测试 66 | - Depth:深度 67 | - Light:光照 68 | - Transform:变换 69 | - Normalized Device Coordinates:标准化设备坐标,NDC 70 | - Position:位置 71 | - Coordinate Space:坐标空间 72 | - Screen-space Coordinates:屏幕空间坐标 73 | - VBO:Vertex Buffer Objects,顶点缓冲对象 74 | - Vertex Attribute:顶点属性 75 | - Position:位置 76 | - Location:位置值 77 | - Vector:向量 78 | - Perspective Division:透视划分 79 | - Fragment Shader:片段着色器 80 | - Component:分量 81 | - Element:元素 82 | - Normalize:标准化 83 | - Stride:步长 84 | - Offset:偏移量 85 | - VAO:顶点数组对象,Vertex Array Object 86 | - Element Buffer Object,Index Buffer Object:EBO,IBO,索引缓冲对象 87 | - Wireframe Mode:线框模式 88 | - Stage:阶段 89 | 90 | ## 01-05 91 | 92 | - uniform:uniform 93 | - Matrix:矩阵 94 | - Texture:纹理 95 | - Swizzling:重组 96 | - Global:全局 97 | - Query:查询 98 | - Overload:重载 99 | - Rasterizer:光栅 100 | - Fragment Interpolation:片段插值 101 | - Interpolate:插值 102 | - Preprocessor Directives:预处理指令 103 | - Debug:调试 104 | 105 | ## 01-06 106 | 107 | - Texture Coordinate:纹理坐标 108 | - Sampling:采样 109 | - Wrapping:环绕方式 110 | - Clamp:约束 111 | - Nearest Neighbor Filtering:临近过滤 112 | - Texture Pixel,Texel:纹理像素 113 | - (Bi)linear Filtering:线性过滤 114 | - Magnify:放大 115 | - Minify:缩小 116 | - Mipmap:多级渐远纹理 117 | - Channel:通道 118 | - Sampler:采样器 119 | - Texture Unit:纹理单元 120 | 121 | ## 01-07 122 | 123 | - Direction:方向 124 | - Magnitude:大小 125 | - Dimension(数学):维度 126 | - Scalar:标量 127 | - Position Vector:位置向量 128 | - Unit Vector:单位向量 129 | - Pythagoras Theorem:勾股定理 130 | - Dot Product:点乘,点积 131 | - Cross Product:叉乘,叉积 132 | - Identity Matrix:单位矩阵 133 | - Scale:缩放 134 | - Translation:位移 135 | - Homogeneous Coordinate:齐次坐标 136 | - Direction Vector:方向向量 137 | - Rotation:旋转 138 | - Rotation Axis:旋转轴 139 | - Column-major Ordering:列主序 140 | 141 | ## 01-08 142 | 143 | - Local Space:局部空间 144 | - Object Space:物体空间 145 | - World Space:世界空间 146 | - View Space:观察空间 147 | - Eye Space:视觉空间 148 | - Clip Space:裁剪空间 149 | - Screen Space:屏幕空间 150 | - Model Matrix:模型矩阵 151 | - View Matrix:观察矩阵 152 | - Projection Matrix:投影矩阵 153 | - Viewport Transform:视口变换 154 | - Clipping Volume:裁剪体积 155 | - Viewing Box:观察箱 156 | - Perspective Division:透视除法 157 | - Z-buffer:Z缓冲 158 | - Draw:绘制 159 | - Depth Testing:深度测试 160 | - Depth Buffer:深度缓冲 161 | 162 | ## 01-09 163 | 164 | - Direction Vector:方向向量 165 | - Camera Space:摄像机空间 166 | - Gram-Schmidt Process:格拉姆—施密特正交化 167 | - LookAt Matrix:LookAt矩阵 168 | - Strafe:(?)扫射 169 | - Deltatime:时间差 170 | - Euler Angles:欧拉角 171 | - Pitch:俯仰角 172 | - Yaw:偏航角 173 | - Roll:滚转角 174 | 175 | ## 06-01 176 | 177 | - Debugging:调试 178 | - Flag:标记 179 | - Reference Compiler:参考编译器 180 | - Tessellation Control Shader:细分控制着色器 181 | - Tessellation Evaluation Shader:细分计算着色器 182 | - Compute Shader:计算着色器 183 | - Attachment:附件 184 | - Render Buffer Object:渲染缓冲对象 185 | 186 | ## 06-02 187 | 188 | - Character:字符 189 | - Quad:四边形 190 | - Mesh:网格 191 | - Glyph:字形 192 | - Baseline:基线 193 | - Bitmap:位图 194 | - Metric:度量值 195 | 196 | ## 06-03-01 197 | 198 | - Level:关卡 199 | - Gameplay State:游戏状态 200 | - Singleton:单一实例 201 | - Single Responsibility Principle:单一功能原则 -------------------------------------------------------------------------------- /mdx_math.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | ''' 4 | Math extension for Python-Markdown 5 | ================================== 6 | 7 | Adds support for displaying math formulas using [MathJax](http://www.mathjax.org/). 8 | 9 | Author: 2015, Dmitry Shachnev . 10 | ''' 11 | 12 | import markdown 13 | 14 | class MathExtension(markdown.extensions.Extension): 15 | def __init__(self, *args, **kwargs): 16 | self.config = { 17 | 'enable_dollar_delimiter': [False, 'Enable single-dollar delimiter'], 18 | 'render_to_span': [False, 19 | 'Render to span elements rather than script for fallback'], 20 | } 21 | super(MathExtension, self).__init__(*args, **kwargs) 22 | 23 | def extendMarkdown(self, md, md_globals): 24 | def handle_match_inline(m): 25 | if self.getConfig('render_to_span'): 26 | node = markdown.util.etree.Element('span') 27 | node.set('class', 'tex') 28 | node.text = ("\\\\(" + markdown.util.AtomicString(m.group(3)) + 29 | "\\\\)") 30 | else: 31 | node = markdown.util.etree.Element('script') 32 | node.set('type', 'math/tex') 33 | node.text = markdown.util.AtomicString(m.group(3)) 34 | return node 35 | 36 | def handle_match(m): 37 | node = markdown.util.etree.Element('script') 38 | node.set('type', 'math/tex; mode=display') 39 | if '\\begin' in m.group(2): 40 | node.text = markdown.util.AtomicString(m.group(2) + m.group(4) + m.group(5)) 41 | else: 42 | node.text = markdown.util.AtomicString(m.group(3)) 43 | return node 44 | 45 | inlinemathpatterns = ( 46 | markdown.inlinepatterns.Pattern(r'(? 58 | ``` 59 | 60 | - 如果图片有背景颜色的话请使用tools目录下的`ClearBG.py`清除为透明 61 | 62 | 其他的class名称还有: 63 | 64 | - clean 65 | - left 66 | - right 67 | - small 68 | - medium 69 | - large 70 | 71 | ## 标题 72 | 73 | - 每一节标题使用`#`(h1)标题(到后面会有几节有很多小节的,太小的标题不明显) 74 | - 根据原文标题大小逐渐递增标题 75 | - 注意`#`后与标题前要加一个空格 76 | - 标题不要添加翻译,对于名词的翻译请写在文中 77 | 78 | ## 链接 79 | 80 | - 所有的引用链接请使用相对链接,地址为从当前文件目录转到引用文件的相对地址(文件名结尾为`.md`) 81 | 82 | ## 列表 83 | 84 | - 列表请与其他元素之间空一行,否则解析会出错。 85 | 86 | ## 专有名词 87 | 88 | - 专有名词需要在第一次出现的之后用括号标注原文 89 | - 原文单词按照标题大写规则大写首字母 90 | - 翻译 91 | - 首先,请与本工程中大部分的翻译保持一致 92 | - 如果工程中找不到已有的翻译,请参考本文档最下面的词汇表寻找翻译 93 | - 如果还是找不到,可以自己创造一个翻译,或者直接写英文 94 | - “Additional resources”译作“附加资源”,“Exercises”译作“练习”,“Solution”译作“参考解答” 95 | 96 | ## 特殊元素 97 | 98 | - 已经安装MathJax插件,如果想要添加数学公式的话直接使用代码就行了: 99 | 100 | 如果是行内的数学公式: 101 | 102 | ``` 103 | \(...\) 104 | ``` 105 | 106 | 如果是独立的数学公式: 107 | 108 | ``` 109 | $$ 110 | ... 111 | $$ 112 | ``` 113 | 114 | 数学公式可以通过右击原文中的公式Show Math As->Tex Commands,复制弹出窗口内的代码获得。 115 | 116 | - 视频用Video标签添加 117 | 118 | ```html 119 | 120 | 121 | ``` 122 | 123 | - 短的译注直接用中文括号插入文中标明译注即可,例如: 124 | 125 | ``` 126 | 文本(译注:[text]) 127 | ``` 128 | 129 | - 如果有比较长的译注,请将以下标记插入文本的段落之后: 130 | 131 | ``` 132 | !!! note "译注" 133 | 134 | [text] 135 | ``` 136 | 137 | - 原文中的红色方框请用`!!! attention`标注,绿色方框请用`!!! important`标注,注意文本前有个Tab,格式如下: 138 | 139 | 红色方框: 140 | 141 | ``` 142 | !!! attention 143 | 144 | [text] 145 | ``` 146 | 147 | 绿色方框: 148 | 149 | ``` 150 | !!! important 151 | 152 | [text] 153 | ``` 154 | 155 | ## 特殊词汇标记 156 | 157 | - 定义:`Definition` 158 | - 函数及类名:`Program logic` 159 | - 变量:`Variables` 160 | - 标记的时候记得不要把中文翻译标记进去了 161 | - 原文中的斜体如果译成中文一律用加粗表示(中文并不存在斜体),如果仍留为英文,请在单词两侧都添加空格与中文分开再改为斜体,粗体也用粗体表示,注意不要自己违反原文添加粗体 162 | 163 | ## 专业词汇对照表 164 | 165 | 1. [专有词汇翻译记录](https://github.com/LearnOpenGL-CN/LearnOpenGL-CN/blob/new-theme/glossary.md) 166 | 2. [微软术语搜索](https://www.microsoft.com/Language/zh-cn/Search.aspx) 167 | 3. [《游戏引擎架构》中英词汇索引表](http://www.cnblogs.com/miloyip/p/GameEngineArchitectureIndex.html) 168 | 4. 摘抄自《OpenGL超级宝典第五版》: 169 | 170 | 英文词 | 对应翻译 171 | ---|--- 172 | Aliasing | 锯齿 173 | Alpha | 透明度 174 | Ambient Light|环境光 175 | Antialiasing|抗锯齿 176 | Aspect Ratio|纵横比 177 | Bezier curve|贝塞尔曲线 178 | Bitplane|位平面 179 | Buffer|缓冲区 180 | Cartesian|笛卡尔 181 | Clip coordinates|裁剪坐标 182 | Clipping|裁剪 183 | Convex|凸 184 | Culling|剔除 185 | Destination color|目标颜色 186 | Dithering|抖动 187 | Double buffered|双缓冲 188 | Extruded|拉伸 189 | Eye coordinates|视觉坐标 190 | Frustum|平头截体 191 | Immediate mode|立即模式 192 | Implementation|实现 193 | Khronos|OpenGL维护小组 194 | Literal|字面值 195 | Matrix|矩阵 196 | Mipmapping|Mip贴图 197 | Modelview Matrix|模型视图矩阵 198 | Normal|法线 199 | Normalize|规范化 200 | Orthographic|正交 201 | Prespective|透视 202 | Piexl|像素 203 | Pixmap|像素图 204 | Polygon|多边形 205 | Primitive|图元 206 | Projection|投影 207 | Quadrilateral|四边形 208 | Resterize|光栅化 209 | Retained mode|保留模式 210 | Render|渲染 211 | Scintillation|闪烁 212 | Shader|着色器 213 | Source Color|源颜色 214 | Specification|说明 215 | Spline|样条 216 | Stipple|点画 217 | Tessellation|镶嵌 218 | Texel|纹理单元 219 | Texture|纹理 220 | Transformation|变换 221 | Translucence|半透明 222 | Vector|向量 223 | Vertex|顶点 224 | Viewing Volume|可视区域 225 | Viewport|视口 226 | Wireframe|线框 227 | pipeline | 渲染管线 -------------------------------------------------------------------------------- /tools/ClearBG.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | 很简陋的一个颜色替换工具,当原图片有背景色的时候请使用这个将背景颜色清除。 5 | 6 | 运行需要Pillow,如果没有安装的话请输入以下指令安装: 7 | $ pip install Pillow 8 | 9 | 输入颜色的时候请在每个值中间加一个空格。 10 | 常用的背景颜色有: 11 | - 238 238 238 255 12 | - 241 241 241 255 13 | 14 | 输入的颜色最终会被替换为透明,输出文件为'noBG.png'。 15 | """ 16 | 17 | from PIL import Image 18 | 19 | file_name = input("Filename: ") 20 | r, g, b, a = map(int, input("Color(R G B A): ").split()) 21 | 22 | if not (0 <= r <= 255 or 0 <= g <= 255 or 0 <= b <= 255 or 0 <= a <= 255): 23 | print("Color value error, please input valid numbers(Range: 0-255).") 24 | exit(1) 25 | 26 | img = Image.open(file_name) 27 | img = img.convert('RGBA') 28 | pixel = img.load() 29 | 30 | for x in range(0, img.size[0]): 31 | for y in range(0, img.size[1]): 32 | if pixel[x, y] == (r, g, b, 255): 33 | img.putpixel((x, y), (0, 0, 0, 0)) 34 | 35 | img.save('noBG.png') 36 | -------------------------------------------------------------------------------- /tools/README.md: -------------------------------------------------------------------------------- 1 | # 工具 2 | 3 | 本目录中包含一些工具供翻译或校对时使用。 4 | 5 | ## ClearBG.py 6 | 7 | 很简陋的一个颜色替换工具,当原图片有背景色的时候请使用这个将背景颜色清除。 8 | 9 | 运行需要Pillow,如果没有安装的话请输入以下指令安装: 10 | 11 | ```bash 12 | $ pip install Pillow 13 | ``` 14 | 15 | 输入颜色的时候请在每个值中间加一个空格。 16 | 常用的背景颜色有: 17 | 18 | - 238 238 238 255 19 | - 241 241 241 255 20 | 21 | 输入的颜色最终会被替换为透明,输出文件为'noBG.png'。 -------------------------------------------------------------------------------- /yeti/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/yeti/__init__.py -------------------------------------------------------------------------------- /yeti/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {% if page_description %}{% endif %} 8 | {% if site_author %}{% endif %} 9 | {% if canonical_url %}{% endif %} 10 | {% if favicon %} 11 | {% else %}{% endif %} 12 | 13 | {% if page_title %}{{ page_title }} - {% endif %}{{ site_name }} 14 | 15 | 16 | 17 | 18 | 19 | {%- for path in extra_css %} 20 | 21 | {%- endfor %} 22 | 23 | 24 | 28 | 29 | 37 | 38 | 39 | 40 | 41 | {% include "nav.html" %} 42 | 43 | 44 | {% include "toc.html" %} 45 | {% include "content.html" %} 46 | 47 | 48 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | {%- for path in extra_javascript %} 63 | 64 | {%- endfor %} 65 | 66 | 67 | 68 | 69 | 70 | ×关闭 71 | 搜索 72 | 73 | 74 | 75 | 请在下面输入你要搜索的文本(仅支持英文): 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /yeti/content.html: -------------------------------------------------------------------------------- 1 | {% if meta.source %} 2 | 3 | {% for filename in meta.source %} 4 | {{ filename }} 5 | {% endfor %} 6 | 7 | {% endif %} 8 | 9 | {{ content }} 10 | 11 | 12 | 22 | 请启用JavaScript以浏览Disqus评论。 23 | -------------------------------------------------------------------------------- /yeti/css/base.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 70px; 3 | } 4 | 5 | /* 6 | * The code below adds some padding to the top of the current anchor target so 7 | * that, when navigating to it, the header isn't hidden by the navbar at the 8 | * top. This is especially complicated because we want to *remove* the padding 9 | * after navigation so that hovering over the header shows the permalink icon 10 | * correctly. Thus, we create a CSS animation to remove the extra padding after 11 | * a second. We have two animations so that navigating to an anchor within the 12 | * page always restarts the animation. 13 | * 14 | * See for more details. 15 | */ 16 | :target::before { 17 | content: ""; 18 | display: block; 19 | margin-top: -75px; 20 | height: 75px; 21 | pointer-events: none; 22 | animation: 0s 1s forwards collapse-anchor-padding-1; 23 | } 24 | 25 | body.clicky :target::before { 26 | animation-name: collapse-anchor-padding-2; 27 | } 28 | 29 | @keyframes collapse-anchor-padding-1 { 30 | to { 31 | margin-top: 0; 32 | height: 0; 33 | } 34 | } 35 | 36 | @keyframes collapse-anchor-padding-2 { 37 | to { 38 | margin-top: 0; 39 | height: 0; 40 | } 41 | } 42 | 43 | ul.nav li.main { 44 | font-weight: bold; 45 | } 46 | 47 | div.col-md-3 { 48 | padding-left: 0; 49 | } 50 | 51 | div.col-md-9 { 52 | padding-bottom: 100px; 53 | } 54 | 55 | div.source-links { 56 | float: right; 57 | } 58 | 59 | div.col-md-9 img { 60 | max-width: 100%; 61 | } 62 | 63 | code { 64 | padding: 1px 3px; 65 | background: #f5f5f5; 66 | border: solid 1px #ccc; 67 | color: #333; 68 | } 69 | 70 | pre code { 71 | background: transparent; 72 | border: none; 73 | } 74 | 75 | a > code { 76 | color: #008cba; 77 | } 78 | 79 | a > code:hover, a > code:focus { 80 | color: #00526e; 81 | } 82 | 83 | /* 84 | * Side navigation 85 | * 86 | * Scrollspy and affixed enhanced navigation to highlight sections and secondary 87 | * sections of docs content. 88 | */ 89 | 90 | /* By default it's not affixed in mobile views, so undo that */ 91 | .bs-sidebar.affix { 92 | position: static; 93 | } 94 | 95 | .bs-sidebar.well { 96 | padding: 0; 97 | } 98 | 99 | /* First level of nav */ 100 | .bs-sidenav { 101 | margin-top: 30px; 102 | margin-bottom: 30px; 103 | padding-top: 10px; 104 | padding-bottom: 10px; 105 | border-radius: 5px; 106 | } 107 | 108 | /* All levels of nav */ 109 | .bs-sidebar .nav > li > a { 110 | display: block; 111 | padding: 5px 20px; 112 | z-index: 1; 113 | } 114 | .bs-sidebar .nav > li > a:hover, 115 | .bs-sidebar .nav > li > a:focus { 116 | text-decoration: none; 117 | border-right: 1px solid; 118 | } 119 | .bs-sidebar .nav > .active > a, 120 | .bs-sidebar .nav > .active:hover > a, 121 | .bs-sidebar .nav > .active:focus > a { 122 | font-weight: bold; 123 | background-color: transparent; 124 | border-right: 1px solid; 125 | } 126 | 127 | /* Nav: second level (shown on .active) */ 128 | .bs-sidebar .nav .nav { 129 | display: none; /* Hide by default, but at >768px, show it */ 130 | margin-bottom: 8px; 131 | } 132 | .bs-sidebar .nav .nav > li > a { 133 | padding-top: 3px; 134 | padding-bottom: 3px; 135 | padding-left: 30px; 136 | font-size: 90%; 137 | } 138 | 139 | /* Show and affix the side nav when space allows it */ 140 | @media (min-width: 992px) { 141 | .bs-sidebar .nav > .active > ul { 142 | display: block; 143 | } 144 | /* Widen the fixed sidebar */ 145 | .bs-sidebar.affix, 146 | .bs-sidebar.affix-bottom { 147 | width: 213px; 148 | } 149 | .bs-sidebar.affix { 150 | position: fixed; /* Undo the static from mobile first approach */ 151 | top: 80px; 152 | } 153 | .bs-sidebar.affix-bottom { 154 | position: absolute; /* Undo the static from mobile first approach */ 155 | } 156 | .bs-sidebar.affix-bottom .bs-sidenav, 157 | .bs-sidebar.affix .bs-sidenav { 158 | margin-top: 0; 159 | margin-bottom: 0; 160 | } 161 | } 162 | @media (min-width: 1200px) { 163 | /* Widen the fixed sidebar again */ 164 | .bs-sidebar.affix-bottom, 165 | .bs-sidebar.affix { 166 | width: 263px; 167 | } 168 | } 169 | 170 | .headerlink { 171 | display: none; 172 | padding-left: .5em; 173 | } 174 | 175 | h1:hover .headerlink, h2:hover .headerlink, h3:hover .headerlink, h4:hover .headerlink, h5:hover .headerlink, h6:hover .headerlink{ 176 | display:inline-block; 177 | } 178 | 179 | /* display submenu relative to parent*/ 180 | .dropdown-submenu { 181 | position: relative; 182 | } 183 | 184 | /* sub menu stlye */ 185 | .dropdown-submenu>.dropdown-menu { 186 | top: 0; 187 | left: 100%; 188 | margin-top: 0px; 189 | margin-left: -1px; 190 | } 191 | 192 | /* display sub menu on hover*/ 193 | .dropdown-submenu:hover>.dropdown-menu { 194 | display: block; 195 | } 196 | 197 | /* little arrow */ 198 | .dropdown-submenu>a:after { 199 | display: block; 200 | content: " "; 201 | float: right; 202 | width: 0; 203 | height: 0; 204 | border-color: transparent; 205 | border-style: solid; 206 | border-width: 5px 0 5px 5px; 207 | border-left-color: #ccc; 208 | margin-top: 5px; 209 | margin-right: -10px; 210 | } 211 | 212 | /* little arrow of parent menu */ 213 | .dropdown-submenu:hover>a:after { 214 | border-left-color: #fff; 215 | } 216 | -------------------------------------------------------------------------------- /yeti/css/highlight.css: -------------------------------------------------------------------------------- 1 | /* Base16 Atelier Sulphurpool Light - Theme */ 2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/sulphurpool) */ 3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */ 4 | 5 | /* Atelier-Sulphurpool Comment */ 6 | .hljs-comment, 7 | .hljs-quote { 8 | color: #6b7394; 9 | } 10 | 11 | /* Atelier-Sulphurpool Red */ 12 | .hljs-variable, 13 | .hljs-template-variable, 14 | .hljs-attribute, 15 | .hljs-tag, 16 | .hljs-name, 17 | .hljs-regexp, 18 | .hljs-link, 19 | .hljs-name, 20 | .hljs-selector-id, 21 | .hljs-selector-class { 22 | color: #c94922; 23 | } 24 | 25 | /* Atelier-Sulphurpool Orange */ 26 | .hljs-number, 27 | .hljs-meta, 28 | .hljs-built_in, 29 | .hljs-builtin-name, 30 | .hljs-literal, 31 | .hljs-type, 32 | .hljs-params { 33 | color: #c76b29; 34 | } 35 | 36 | /* Atelier-Sulphurpool Green */ 37 | .hljs-string, 38 | .hljs-symbol, 39 | .hljs-bullet { 40 | color: #ac9739; 41 | } 42 | 43 | /* Atelier-Sulphurpool Blue */ 44 | .hljs-title, 45 | .hljs-section { 46 | color: #3d8fd1; 47 | } 48 | 49 | /* Atelier-Sulphurpool Purple */ 50 | .hljs-keyword, 51 | .hljs-selector-tag { 52 | color: #6679cc; 53 | } 54 | 55 | .hljs { 56 | display: block; 57 | overflow-x: auto; 58 | background: #f5f7ff; 59 | color: #5e6687; 60 | padding: 0.5em; 61 | } 62 | 63 | .hljs-emphasis { 64 | font-style: italic; 65 | } 66 | 67 | .hljs-strong { 68 | font-weight: bold; 69 | } 70 | -------------------------------------------------------------------------------- /yeti/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/yeti/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /yeti/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/yeti/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /yeti/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/yeti/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /yeti/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omni360/LearnOpenGL-CN/c3ba06745eaada8c5f0b37a2c3d4e6f4dbecd11e/yeti/img/favicon.ico -------------------------------------------------------------------------------- /yeti/js/base.js: -------------------------------------------------------------------------------- 1 | /* Search */ 2 | 3 | function getSearchTerm() 4 | { 5 | var sPageURL = window.location.search.substring(1); 6 | var sURLVariables = sPageURL.split('&'); 7 | for (var i = 0; i < sURLVariables.length; i++) 8 | { 9 | var sParameterName = sURLVariables[i].split('='); 10 | if (sParameterName[0] == 'q') { 11 | return sParameterName[1]; 12 | } 13 | } 14 | } 15 | 16 | $(document).ready(function() { 17 | var search_term = getSearchTerm(), 18 | $search_modal = $('#mkdocs_search_modal'); 19 | 20 | if(search_term) { 21 | $search_modal.modal(); 22 | } 23 | 24 | $search_modal.on('shown.bs.modal', function () { 25 | $search_modal.find('#mkdocs-search-query').focus(); 26 | }); 27 | }); 28 | 29 | 30 | /* Highlight */ 31 | $( document ).ready(function() { 32 | hljs.initHighlightingOnLoad(); 33 | $('table').addClass('table table-striped table-hover'); 34 | }); 35 | 36 | 37 | $('body').scrollspy({ 38 | target: '.bs-sidebar', 39 | }); 40 | 41 | /* Toggle the `clicky` class on the body when clicking links to let us 42 | retrigger CSS animations. See ../css/base.css for more details. */ 43 | $('a').click(function(e) { 44 | $('body').toggleClass('clicky'); 45 | }); 46 | 47 | /* Prevent disabled links from causing a page reload */ 48 | $("li.disabled a").click(function() { 49 | event.preventDefault(); 50 | }); 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /yeti/nav-sub.html: -------------------------------------------------------------------------------- 1 | {% if not nav_item.children %} 2 | 3 | {{ nav_item.title }} 4 | 5 | {% else %} 6 | 7 | {{ nav_item.title }} 8 | 9 | {% for nav_item in nav_item.children %} 10 | {% include "nav-sub.html" %} 11 | {% endfor %} 12 | 13 | 14 | {% endif %} 15 | -------------------------------------------------------------------------------- /yeti/nav.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Toggle navigation 9 | 10 | 11 | 12 | 13 | 14 | 15 | {{ site_name }} 16 | 17 | 18 | 19 | 20 | 21 | 22 | {% for nav_item in nav %} 23 | {% if nav_item.children %} 24 | 25 | {{ nav_item.title }} 26 | 27 | {% for nav_item in nav_item.children %} 28 | {% include "nav-sub.html" %} 29 | {% endfor %} 30 | 31 | 32 | {% else %} 33 | 34 | {{ nav_item.title }} 35 | 36 | {% endif %} 37 | {% endfor %} 38 | 39 | 40 | 41 | 42 | 43 | 44 | 搜索 45 | 46 | 47 | 48 | 49 | 上一节 50 | 51 | 52 | 53 | 54 | 下一节 55 | 56 | 57 | {% if repo_url %} 58 | 59 | 60 | {% if repo_name == 'GitHub' %} 61 | 62 | {% elif repo_name == 'Bitbucket' %} 63 | 64 | {% endif %} 65 | {{ repo_name }} 66 | 67 | 68 | {% endif %} 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /yeti/toc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% for toc_item in toc %} 4 | {{ toc_item.title }} 5 | {% for toc_item in toc_item.children %} 6 | {{ toc_item.title }} 7 | {% endfor %} 8 | {% endfor %} 9 | 10 | 11 | --------------------------------------------------------------------------------
75 | 请在下面输入你要搜索的文本(仅支持英文): 76 |