Cainiao learn ogre and tianlong Babu 13th: bloom full screen soft light

Source: Internet
Author: User

After searching for the CG file, you can find the file,

The full screen softening effect of the bloom implemented by the shader is a bit obscure, and it doesn't feel clear about the vortex.

It's too vague to mix twice. We should make it blur, ghost

This FPS drops so fast...

 

 

Because Sohu does not provide synthesizer scripts, we need to implement Synthesizer by code.

 

I developed my own source code, fuzzy version:

// Bloom <br/> compositorptr comp = compositormanager: getsingleton (). create ("bloom", "tlbb"); <br/>{< br/> compositiontechnique * t = comp-> createtechnique (); <br/>{< br/> compositiontechnique: texturedefinition * def = T-> createtexturedefinition ("rt0"); <br/> def-> width = 0; <br/> def-> Height = 0; <br/> def-> Format = pf_r8g8b8; <br/>}< br/>{< br/> compositiontechnique :: texturedefinition * def = T-> createtexturedefinition ("rt1"); <br/> def-> width = 0; <br/> def-> Height = 0; <br/> def-> Format = pf_r8g8b8; <br/>}< br/>{< br/> compositiontechnique :: texturedefinition * def = T-> createtexturedefinition ("rt2"); <br/> def-> width = 0; <br/> def-> Height = 0; <br/> def-> Format = pf_r8g8b8; <br/>}< br/>{< br/> compositiontargetpass * TP = T-> createtargetpass (); <br/> TP-> setinputmode (compositiontargetpass: im_previous); <br/> TP-> setoutputname ("rt1 "); <br/>}< br/>{< br/> compositiontargetpass * TP = T-> createtargetpass (); <br/> TP-> setinputmode (compositiontargetpass: im_previous ); <br/> TP-> setoutputname ("rt2"); <br/>}< br/>{< br/> compositiontargetpass * TP = T-> createtargetpass (); <br/> TP-> setinputmode (compositiontargetpass: im_none); <br/> TP-> setoutputname ("rt0 "); <br/> compositionpass * pass = TP-> createpass (); <br/> pass-> settype (compositionpass: pt_renderquad ); <br/> pass-> setmaterialname ("postfilters/bloom/blur"); <br/> pass-> setinput (0, "rt1 "); <br/>}< br/>{< br/> compositiontargetpass * TP = T-> createtargetpass (); <br/> TP-> setinputmode (compositiontargetpass: im_none ); <br/> TP-> setoutputname ("rt1"); <br/> compositionpass * pass = TP-> createpass (); <br/> pass-> settype (compositionpass:: pt_renderquad); <br/> pass-> setmaterialname ("postfilters/bloom/blur"); <br/> pass-> setinput (0, "rt0 "); <br/>}< br/>{< br/> compositiontargetpass * TP = T-> getoutputtargetpass (); <br/> TP-> setinputmode (compositiontargetpass: im_none ); <br/> {compositionpass * pass = TP-> createpass (); <br/> pass-> settype (compositionpass: pt_renderquad ); <br/> pass-> setmaterialname ("postfilters/bloom/FINAL"); <br/> pass-> setinput (0, "rt2 "); <br/> pass-> setinput (1, "rt1"); <br/>}< br/>}

 

// Do it once, clear a lot:

 

// Bloom <br/> compositorptr comp = compositormanager: getsingleton (). create ("bloom", "tlbb"); <br/>{< br/> compositiontechnique * t = comp-> createtechnique (); <br/>{< br/> compositiontechnique: texturedefinition * def = T-> createtexturedefinition ("<input> "); <br/>}< br/>{< br/> compositiontechnique: texturedefinition * def = T-> createtexturedefinition ("<input1> "); <br/>}< br/>{< br/> compositiontargetpass * TP = T-> createtargetpass (); <br/> TP-> setinputmode (compositiontargetpass: im_previous ); <br/> TP-> setoutputname ("<input> "); <br/>}< br/>{< br/> compositiontargetpass * TP = T-> createtargetpass (); <br/> TP-> setinputmode (compositiontargetpass: im_none ); <br/> TP-> setoutputname ("<input1>"); <br/> compositionpass * pass = TP-> createpass (); <br/> pass-> settype (compositionpass: pt_renderquad); <br/> pass-> setmaterialname ("postfilters/bloom/blur "); <br/> pass-> setinput (0, "<input> "); <br/>}< br/>{< br/> compositiontargetpass * TP = T-> getoutputtargetpass (); <br/> TP-> setinputmode (compositiontargetpass: im_none ); <br/> {compositionpass * pass = TP-> createpass (); <br/> pass-> settype (compositionpass: pt_renderquad ); <br/> pass-> setmaterialname ("postfilters/bloom/FINAL"); <br/> pass-> setinput (0, "<input1> "); <br/> pass-> setinput (1, "<input>"); <br/>}< br/>}

 

 

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.