Although I did not have a lot of original parts, I was able to pass the debugging, but there were many serious crashes in the middle ...... It is estimated that the new graphics card is used ~~ But the final result is pretty good? Implement glsl on the ocean surfaceSource codeFrom: http://emiug.alanabram.co.uk, feel hisCodeIt is simpler than bonzai (the latter needs waterTextureReflection/scattering/normal/depth/dudvTextureThe water surface effect of 3dvri seems to be similar ). However, I am a beginner of glsl and I am not qualified to comment more ~~ OSGProgramNote that the required uniform variables include lightpos, time, normalmap, and cubemap. The latter two are texture samplervers, which must be used in OSG. OSG: Uniform ("normalmap", 0) and OSG: Uniform ("cubemap", 1) to specify the texture units corresponding to the texture sampler, and use settextureattributeandmodes in the corresponding texture unitsSetCorrect texture pattern. As for the realization of ocean effect, it should be said that it belongs to the scope of mathematics ~~ You may want to learn about the attachment code. Glsl can be used to implement a lot of eye-catching 3D special effects. Unfortunately, there seems to be very few research materials in China. There is only one book translated from OpenGL shading language, I hope more friends can share their experiences and achievements. Just like Alan Abram, who is not familiar with us ~~ [This post was last edited by array] |