Ocean effects achieved using glsl

Source: Internet
Author: User

Http://bbs.osgchina.org/viewthread.php? Tid = 342 & extra = Page % 3d3

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]

Myocean.rar (305.23 KB)

Downloads: 519

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.