当前位置:网站首页>Debug No3 multi texture overlay
Debug No3 multi texture overlay
2022-07-24 07:44:00 【Liu jingyiru】
2022 year 7 month 17 Japan In the morning 9 Half past six
After realizing the application of single texture , Want to practice , Multiple texture overlay combinations .
1.bug state : There are some prompts and errors on the console
analysis : This part of the code implementation is incomplete , No texture cells are set to get values .
2.bug state :location I can't get it shader programmatic ID, But these two methods are all right in theory (1) Will get ID Methods , Encapsulated into Shader Member methods of class (2) adopt Shader class , Get member variable ID
![]()
analysis : Method (1) The idea of partial encapsulation vec4(vec3,1.0) But put glUniform1i It's a mistake glUniforml1.
Method (2) Because make class members private , So it's not accessible .
In addition, this exposes Shader Of ID Information , Not a good way .
solve : check dos.gl Look up the documents , The parameters of the lower function are studied .ID Is to call the Shader Handle to the program . On the premise that there is no problem with the theory , The analysis should focus on errors . And go to the blog to find relevant solutions , It's a waste of time . The information is not accurate enough .
3.bug state : Two textures in the fragment shader and in the main function call , Different names , Another binary coordinate and a quaternion coordinate cannot be processed correspondingly .
analysis : The fragment shader program is an argument , And the main function is also an argument , Keep the parameters uniform . Although the methods and steps of importing two textures and one texture are similar , But the treatment is different , You need to set the texture unit , Consider the stacking order, texture wrapping, and so on .
4.bug state : Only one texture is displayed , Non superimposed effect .
analysis : Picture reading problem , Break point debugging , Read successful , exclude . So I guess the first picture may be covered . Try deleting a picture , It always shows the second , determine bug reason .
solve : Two pictures cannot be read continuously , You need to bind the first one before reading the second . reason : Because two pictures use a pointer , There is a call order problem .

summary : I'm looking for it today Bug It took nearly two hours . Wasted on and OpenGL Document comparison , I should improve my reading ability of code framework . Realize by yourself first , Then compare the idea of source code .
in addition , Also found when solving problems Not targeted , If it works in theory , Actually looking for bug It's easier . One is grammar , One is whether the steps are complete . When correcting mistakes, don't think too widely . One way doesn't work , Don't try again and again aimlessly .
Learning methods : Code comes first . Theory is auxiliary . No concept of words , Only solve practical problems . Daily correspondence OpenGL Complete the exercise of .

边栏推荐
- Induction, generalization, deduction
- 无法自动装配,未找到“RedisTemplate类型的Bean
- Selenium basic knowledge automatically login Baidu online disk
- Hcip day 9 notes
- Jackson 解析 JSON 详细教程
- Buffer overflow vulnerability of network security module B in national vocational college skills competition
- The growth path of software testing
- R language handwritten numeral recognition
- Sense dimension design responsive layout
- Advanced part 5 of C language. Dynamic memory management
猜你喜欢

JMeter stress test index interpretation

Introduction to C language III Array 4. Operators

Arduino在不同主频下稳定支持的TTL串口速率

Advanced part of C language I. data storage

Train-clean-100 dataset

Harbor2.2 quick check of user role permissions

Selenium basic knowledge automatic search

Hcip 13th day notes

requests-爬虫实现一个简易网页采集器

Facing Tencent (actual combat) - Test Development - detailed explanation of interns (face experience)
随机推荐
JS的DOM操作——style的操作
Collection of binary tree topics
Selenium use
Advanced part of C language IV. detailed explanation of user-defined types
One click Copy and import of web interface data into postman
Vulnhub DC1
Stable TTL serial port rate supported by Arduino under different dominant frequencies
Source code analysis of Nacos configuration center
Hcip day 8 notes
DevOps随笔
C language to achieve mine sweeping game
[sklearn] RF cross validation out of bag data parameter learning curve grid search
Arduino 超级省电之休眠模式用1节18650电池工作17年
从零开始C语言精讲篇3:函数
Selenium basic knowledge automatically login Baidu online disk
23. Component customization events
25.消息订阅与发布——PubSub-js
The goal you specified requires a project to execute but there is no POM in this directory
Selenium basic knowledge debugging method
Appium doctor command error pit - resolved