当前位置:网站首页>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 .

边栏推荐
- Simple Gateway - intranet server safely obtains external network data
- Installation and use of Zen path & defect report & defect operation
- Game three piece chess
- [hiflow] Tencent cloud hiflow scene connector realizes intelligent campus information management
- Math。 Round, numeric rounding, underlying code parsing
- MS SQL Server 2019 学习
- Fopen, fwrite, fseek, fTell, FREAD use demo
- Eight part essay on software testing
- Give a string ① please count the number of times each letter appears ② please print the pair with the most letters
- App performance test case
猜你喜欢
随机推荐
HCIP第十天笔记
[cloud native] MySQL index analysis and query optimization
C language advanced part III. string functions and memory operation functions
FlinkSQL-UDF自定义数据源
Simple Gateway - intranet server safely obtains external network data
Arduino 超级省电之休眠模式用1节18650电池工作17年
Give a string ① please count the number of times each letter appears ② please print the pair with the most letters
JS_ Realize the separation of multiple lines of text into an array according to the newline
Implement a queue with two stacks.
Buffer overflow vulnerability of network security module B in national vocational college skills competition
China trichlorosilane Market Forecast and Strategic Research Report (2022 Edition)
About the solution of thinking that you download torch as a GPU version, but the result is really a CPU version
【Pytorch】Dataset_ DataLoader
Vulnhub DC1
Appium doctor command error pit - resolved
C language file operation
Automatic test and manual test
Introduction to C language I. branch and loop statements
Basic operation of queue
UNI-APP_ Playback and pause of background music of applet or H5 page









