programming blend function

讨论了使用着色器进行RGBE编码(HDRI)的两个片段的混合过程。由于OpenGL的glBlendFunc仅适用于固定管线,更复杂的功能需通过自定义着色器实现。未来OpenGL3将移除固定管线,所有操作将由用户自行定义。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

导读:
  Antonio Bleile
   programming blend function
  Hi,
  I'm currently trying to blend two RGBE (HDRI encoded) fragments
  together.
  The only way this seems to work is through shaders (the shader takes
  as
  input a copy of the RGBE encoded framebuffer, the shader then blends
  the fragments togehter). There is no way to "customize/program" the
  glBlendFunc,
  right? What about OpenGL 3? Will that allow it? And there's absolutely
  no way
  for the fragment shader to access the framebuffer, right? What about
  FBO's?
  Those are ordinary textures, what happens if I just give a fragment
  shader the
  current FBO render target as input (sounds insane, but it might be
  legal?).
  Thank you &Regards,
  Toni
  
  09-16-2007, 03:33 PM
  Wolfgang Draxinger
   Re: programming blend function
  Antonio Bleile wrote:
  >Hi,
  >
  >I'm currently trying to blend two RGBE (HDRI encoded)
  >fragments together.
  >The only way this seems to work is through shaders (the shader
  >takes as input a copy of the RGBE encoded framebuffer, the
  >shader then blends the fragments togehter).
  >There is no way to "customize/program" the glBlendFunc, right?
  glBlendFunc controls a part of the fixed function pipeline.
  Anything different from the fixed function pipeline must be done
  with shaders.
  >What about OpenGL 3? Will that allow it?
  OpenGL 3 will discard the fixed function pipeline completely,
  i.e. you must define all vertex and framgment processing
  yourself. This will also mean, that a lot of API functions will
  be removed, among them glBlendFunc.
  >And there's absolutely no way for the fragment shader to access
  >the framebuffer, right?
  No, since the framebuffer is in constant change while a primitive
  is processed. So there must be a copy taken somewhere in the
  process.
  >What about FBO's? Those are ordinary textures,
  No they aren't. A FBO can be used as texture, but can do also
  other stuff.
  >what happens if I just give a fragment shader the current FBO
  >render target as input (sounds insane, but it might be legal?).
  Read the FBO spec, it contains an own paragraph exactly about
  this. You can't bind a FBO that's a render target as texture
  within the same render context. And you can't make a texture
  bound FBO as render target.
  Wolfgang Draxinger
  --
  E-Mail address works, Jabber: hexarith--at--jabber.org, ICQ: 134682867
  
  09-16-2007, 10:16 PM
  fungus
   Re: programming blend function
  On Sep 16, 4:42 pm, Antonio Bleile wrote:
  >There is no way to "customize/program" the
  >glBlendFunc, right?
  Right.
  >What about OpenGL 3? Will that allow it?
  No. At the hardware level there's a big gap
  between the pixel shading operations and
  the blending operations. Bringing them
  together would kill performance.
  --
  
  / O O /
  /_____/ FTB. Remove my socks for email address.
  
  09-17-2007, 02:58 AM
  Antonio Bleile
   Re: programming blend function
  On Sep 17, 5:16 am, fungus wrote:
  >On Sep 16, 4:42 pm, Antonio Bleile wrote:
  >
  >>There is no way to "customize/program" the
  >>glBlendFunc, right?
  >
  >Right.
  >
  >>What about OpenGL 3? Will that allow it?
  >
  >No. At the hardware level there's a big gap
  >between the pixel shading operations and
  >the blending operations. Bringing them
  >together would kill performance.
  Alright.....
  Thank you guys!
  Toni

本文转自
http://objectmix.com/graphics/136729-programming-blend-function.html
“replaceFaceBuilder->ReplacementFace()->ReplaceRules(rules2, false);”提示:"NXOpen::SelectFace" 没有成员 "ReplaceRules" 参考以下文档:“#ifndef NXOpen_FEATURES_REPLACEFACEBUILDER_HXX_INCLUDED #define NXOpen_FEATURES_REPLACEFACEBUILDER_HXX_INCLUDED //-------------------------------------------------------------------------- // Copyright 2024 Siemens //-------------------------------------------------------------------------- // Header for C++ interface to JA API //-------------------------------------------------------------------------- // // Source File: // Features_ReplaceFaceBuilder.ja // // Generated by: // apiwrap // // WARNING: // This file is automatically generated - do not edit by hand // #ifdef _MSC_VER #pragma once #endif #include <NXOpen/NXDeprecation.hxx> #include <vector> #include <NXOpen/NXString.hxx> #include <NXOpen/Callback.hxx> #include <NXOpen/GeometricUtilities_FaceChangeOverflowBehavior.hxx> #include <NXOpen/GeometricUtilities_ProjectionOptions.hxx> #include <NXOpen/ModlDirect_SelectBlend.hxx> #include <NXOpen/Features_AdmBaseBuilder.hxx> #include <NXOpen/ScCollector.hxx> #include <NXOpen/SelectObject.hxx> #include <NXOpen/SelectObjectList.hxx> #include <NXOpen/libnxopencpp_features_exports.hxx> #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4996) #endif #ifdef __GNUC__ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif namespace NXOpen { namespace Features { class ReplaceFaceBuilder; } class Expression; namespace Features { class AdmBaseBuilder; } namespace GeometricUtilities { class FaceChangeOverflowBehavior; } namespace GeometricUtilities { class ProjectionOptions; } namespace ModlDirect { class SelectBlend; } class ScCollector; class SelectFace; class SelectFaceList; namespace Features { class _ReplaceFaceBuilderBuilder; class ReplaceFaceBuilderImpl; /** Represents a builder for a replace face feature, don't use it until nx502. <br> To create a new instance of this class, use @link NXOpen::Features::FeatureCollection::CreateReplaceFaceBuilder NXOpen::Features::FeatureCollection::CreateReplaceFaceBuilder @endlink <br> <br> Created in NX5.0.2. <br> */ class NXOPENCPP_FEATURESEXPORT ReplaceFaceBuilder : public NXOpen::Features::AdmBaseBuilder { /** Enumeration of replace face type, don't use it until nx502 <br> Created in NX5.0.2. <br> */ public: enum ReplaceTypes { ReplaceTypesReplace/** This stands for replace type - to replace the surface of the target face with the tool face */, ReplaceTypesSimplify/** This stands for simplify type - to simplify the geometry representation of a surface of a face */ }; private: ReplaceFaceBuilderImpl * m_replacefacebuilder_impl; private: friend class _ReplaceFaceBuilderBuilder; protected: ReplaceFaceBuilder(); public: ~ReplaceFaceBuilder(); /**Returns the replace face type, don't use it until further notification <br> Created in NX5.0.2. <br> <br> License requirements : None */ public: NXOpen::Features::ReplaceFaceBuilder::ReplaceTypes Type ( ); /**Sets the replace face type, don't use it until further notification <br> Created in NX5.0.2. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR insp_programming ("INSPECTION PROGRAMMING") */ public: void SetType ( NXOpen::Features::ReplaceFaceBuilder::ReplaceTypes replaceType /** the replace face type */ ); /**Returns the target faces to replace, only for replace type, don't use it until nx502 <br> Created in NX5.0.2. <br> <br> License requirements : None */ public: NXOpen::ScCollector * FaceToReplace ( ); /**Returns the target faces to replace <br> Created in NX6.0.0. <br> <br> License requirements : None */ public: NXOpen::ScCollector * ReplaceFaces ( ); /**Returns the replacement face, only for replace type, don't use it until nx502 <br> Created in NX5.0.2. <br> <br> License requirements : None */ public: NXOpen::SelectFace * ReplacementFace ( ); /**Returns the replacement faces <br> Created in NX6.0.0. <br> <br> License requirements : None */ public: NXOpen::ScCollector * ReplacementFaces ( ); /**Returns the flag of reverse direction between replace face and the surface of replacement face, only for replace type, don't use it until nx502 <br> Created in NX5.0.2. <br> <br> License requirements : None */ public: bool ReverseDirection ( ); /**Sets the flag of reverse direction between replace face and the surface of replacement face, only for replace type, don't use it until nx502 <br> Created in NX5.0.2. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR insp_programming ("INSPECTION PROGRAMMING") */ public: void SetReverseDirection ( bool reverseDirection /** the flag of reverse direction or not */ ); /**Returns the offset distance of replacement faces <br> Created in NX6.0.0. <br> <br> License requirements : None */ public: NXOpen::Expression * OffsetDistance ( ); /**Returns the offset reverse direction flag of replacement faces <br> Created in NX6.0.0. <br> <br> License requirements : None */ public: bool OffsetReverseDirection ( ); /**Sets the offset reverse direction flag of replacement faces <br> Created in NX6.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR insp_programming ("INSPECTION PROGRAMMING") */ public: void SetOffsetReverseDirection ( bool reverseDirection /** the flag of offset reverse direction */ ); /**Returns the face collector holding the all the recognized blend faces adjacent to faces to replace. It is auto recognized blends + user selected blends - user excluded blends, don't use it until nx502 <br> Created in NX5.0.2. <br> <br> License requirements : None */ public: NXOpen::ModlDirect::SelectBlend * BlendFace ( ); /**Returns the face to simplify, only for simplify type, don't use it until nx502 <br> Created in NX5.0.2. <br> <br> License requirements : None */ public: NXOpen::SelectFaceList * FaceToSimplify ( ); /**Returns the face change overflow behavior. Please refer @link NXOpen::GeometricUtilities::FaceChangeOverflowBehavior NXOpen::GeometricUtilities::FaceChangeOverflowBehavior@endlink for details. <br> Created in NX6.0.2. <br> <br> License requirements : None */ public: NXOpen::GeometricUtilities::FaceChangeOverflowBehavior * FaceChangeOverflowBehavior ( ); /**Returns the free edge projection options, which defines a direction to project laminar boundaries of the original face onto the replacement face. <br> Created in NX11.0.0. <br> <br> License requirements : None */ public: NXOpen::GeometricUtilities::ProjectionOptions * FreeEdgeProjection ( ); /** The function used to set m_resetReplaceFaceMethod in ReplaceFaceBuilder as true <br> Created in NX10.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") */ public: void ResetReplaceFaceMethod ( ); /** The function used to set m_resetFreeEdgeProjectionOption in ReplaceFaceBuilder as true <br> Created in NX11.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") */ public: void ResetFreeEdgeProjectionOption ( ); }; } } #ifdef _MSC_VER #pragma warning(pop) #endif #ifdef __GNUC__ #ifndef NX_NO_GCC_DEPRECATION_WARNINGS #pragma GCC diagnostic warning "-Wdeprecated-declarations" #endif #endif #undef EXPORTLIBRARY #endif ”
08-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值