CESIUM内置shader变量和函数[转]
cesium中内置了一些常量、变量和函数,在vs和fs中可直接使用。
内置uniform
内置uniform主要置于AutomaticUniforms类里面,该类私有未开放文档。
- czm_backgroundColor
An automatic GLSL uniform representing the current scene background color.
Example:
// GLSL declaration
uniform vec4 czm_backgroundColor;
// Example: If the given color's RGB matches the background color, invert it.
vec4 adjustColorForContrast(vec4 color)
{
if (czm_backgroundColor.rgb == color.rgb)
{
color.rgb = vec3(1.0) - color.rgb;
}
return color;
}
- czm_brdfLut
An automatic GLSL uniform containing the BRDF look up texture used for image-based lighting computations.
Example:
// GLSL declaration
uniform sampler2D czm_brdfLut;
// Example: For a given roughness and NdotV value, find the material's BRDF information in the red and green channels
float roughness = 0.5;
float NdotV = dot(normal, view);
vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, 1.0 - roughness)).rg;
An automatic GLSL uniform containing the near distance (
x
) and the far distance (y
) of the frustum defined by the camera. This is the individual frustum used for multi-frustum rendering.Example:
// GLSL declaration
uniform vec2 czm_currentFrustum;
// Example
float frustumLength = czm_currentFrustum.y - czm_currentFrustum.x;
An automatic GLSL uniform representing the high bits of the camera position in model coordinates. This is used for GPU RTE to eliminate jittering artifacts when rendering as described in Precisions, Precisions.
Example:
// GLSL declaration
uniform vec3 czm_encodedCameraPositionMCHigh;
An automatic GLSL uniform representing the low bits of the camera position in model coordinates. This is used for GPU RTE to eliminate jittering artifacts when rendering as described in Precisions, Precisions.
Example:
// GLSL declaration
uniform vec3 czm_encodedCameraPositionMCLow;
An automatic GLSL uniform containing the near distance (
x
) and the far distance (y
) of the frustum defined by the camera. This is the largest possible frustum, not an individual frustum used for multi-frustum rendering.Example:
// GLSL declaration
uniform vec2 czm_entireFrustum;
// Example
float frustumLength = czm_entireFrustum.y - czm_entireFrustum.x;
- czm_environmentMap
An automatic GLSL uniform containing the environment map used within the scene.
Example:
// GLSL declaration
uniform samplerCube czm_environmentMap;
// Example: Create a perfect reflection of the environment map on a model
float reflected = reflect(view, normal);
vec4 reflectedColor = textureCube(czm_environmentMap, reflected);
An automatic GLSL uniform containing height (
x
) and height squared (y
) of the eye (camera) in the 2D scene in meters.
- czm_fogDensity
An automatic GLSL uniform scalar used to mix a color with the fog color based on the distance to the camera.
An automatic GLSL uniform representing the frame number. This uniform is automatically incremented every frame.
- czm_frustumPlanes
The distances to the frustum planes. The top, bottom, left and right distances are the x, y, z, and w components, respectively.
- czm_geometricToleranceOverMeter
An automatic GLSL uniform scalar representing the geometric tolerance per meter
- czm_imagerySplitPosition
An automatic GLSL uniform representing the splitter position to use when rendering imagery layers with a splitter. This will be in pixel coordinates relative to the canvas.
An automatic GLSL uniform representing a 4x4 projection transformation matrix with the far plane at infinity, that transforms eye coordinates to clip coordinates. Clip coordinates is the coordinate system for a vertex shader's
gl_Position
output. An infinite far plane is used in algorithms like shadow volumes and GPU ray casting with proxy geometry to ensure that triangles are not clipped by the far plane.Example:
// GLSL declaration
uniform mat4 czm_infiniteProjection;
// Example
gl_Position = czm_infiniteProjection * eyePosition;
An automatic GLSL uniform representing a 4x4 model transformation matrix that transforms world coordinates to model coordinates.
Example:
// GLSL declaration
uniform mat4 czm_inverseModel;
// Example
vec4 modelPosition = czm_inverseModel * worldPosition;
An automatic GLSL uniform representing a 4x4 transformation matrix that transforms from eye coordinates to model coordinates.
Example:
// GLSL declaration
uniform mat4 czm_inverseModelView;
// Example
vec4 modelPosition = czm_inverseModelView * eyePosition;
An automatic GLSL uniform representing a 4x4 transformation matrix that transforms from eye coordinates to 3D model coordinates. In 3D mode, this is identical to czm_inverseModelView, but in 2D and Columbus View it represents the inverse model-view matrix as if the camera were at an equivalent location in 3D mode. This is useful for lighting 2D and Columbus View in the same way that 3D is lit.
Example:
// GLSL declaration
uniform mat4 czm_inverseModelView3D;
// Example
vec4 modelPosition = czm_inverseModelView3D * eyePosition;
An automatic GLSL uniform representing a 4x4 inverse model-view-projection transformation matrix that transforms clip coordinates to model coordinates. Clip coordinates is the coordinate system for a vertex shader's
gl_Position
output.Example:
// GLSL declaration
uniform mat4 czm_inverseModelViewProjection;
// Example
vec4 modelPosition = czm_inverseModelViewProjection * clipPosition;
An automatic GLSL uniform representing a 3x3 normal transformation matrix that transforms normal vectors in eye coordinates to model coordinates. This is the opposite of the transform provided by czm_normal.
Example:
// GLSL declaration
uniform mat3 czm_inverseNormal;
// Example
vec3 normalMC = czm_inverseNormal * normalEC;
An automatic GLSL uniform representing a 3x3 normal transformation matrix that transforms normal vectors in eye coordinates to 3D model coordinates. This is the opposite of the transform provided by czm_normal. In 3D mode, this is identical to czm_inverseNormal, but in 2D and Columbus View it represents the inverse normal transformation matrix as if the camera were at an equivalent location in 3D mode. This is useful for lighting 2D and Columbus View in the same way that 3D is lit.
Example:
// GLSL declaration
uniform mat3 czm_inverseNormal3D;
// Example
vec3 normalMC = czm_inverseNormal3D * normalEC;
An automatic GLSL uniform representing a 4x4 inverse projection transformation matrix that transforms from clip coordinates to eye coordinates. Clip coordinates is the coordinate system for a vertex shader's
gl_Position
output.Example:
// GLSL declaration
uniform mat4 czm_inverseProjection;
// Example
vec4 eyePosition = czm_inverseProjection * clipPosition;
An automatic GLSL uniform representing a 4x4 transformation matrix that transforms from eye coordinates to world coordinates.
Example:
// GLSL declaration
uniform mat4 czm_inverseView;
// Example
vec4 worldPosition = czm_inverseView * eyePosition;
An automatic GLSL uniform representing a 4x4 transformation matrix that transforms from 3D eye coordinates to world coordinates. In 3D mode, this is identical to czm_inverseView, but in 2D and Columbus View it represents the inverse view matrix as if the camera were at an equivalent location in 3D mode. This is useful for lighting 2D and Columbus View in the same way that 3D is lit.
Example:
// GLSL declaration
uniform mat4 czm_inverseView3D;
// Example
vec4 worldPosition = czm_inverseView3D * eyePosition;
An automatic GLSL uniform representing a 4x4 view-projection transformation matrix that transforms clip coordinates to world coordinates. Clip coordinates is the coordinate system for a vertex shader's
gl_Position
output.Example:
// GLSL declaration
uniform mat4 czm_inverseViewProjection;
// Example
vec4 worldPosition = czm_inverseViewProjection * clipPosition;
An automatic GLSL uniform representing a 3x3 rotation matrix that transforms vectors from eye coordinates to world coordinates.
Example:
// GLSL declaration
uniform mat3 czm_inverseViewRotation;
// Example
vec4 worldVector = czm_inverseViewRotation * eyeVector;
An automatic GLSL uniform representing a 3x3 rotation matrix that transforms vectors from 3D eye coordinates to world coordinates. In 3D mode, this is identical to czm_inverseViewRotation, but in 2D and Columbus View it represents the inverse view matrix as if the camera were at an equivalent location in 3D mode. This is useful for lighting 2D and Columbus View in the same way that 3D is lit.
Example:
// GLSL declaration
uniform mat3 czm_inverseViewRotation3D;
// Example
vec4 worldVector = czm_inverseViewRotation3D * eyeVector;
- czm_invertClassificationColor
An automatic GLSL uniform that will be the highlight color of unclassified 3D Tiles.
- czm_log2FarPlusOne
An automatic GLSL uniform containing log2 of the far distance + 1.0. This is used when reversing log depth computations.
- czm_log2NearDistance
An automatic GLSL uniform containing log2 of the near distance. This is used when writing log depth in the fragment shader.
- czm_minimumDisableDepthTestDistance
An automatic GLSL uniform representing the distance from the camera at which to disable the depth test of billboards, labels and points to, for example, prevent clipping against terrain. When set to zero, the depth test should always be applied. When less than zero, the depth test should never be applied.
An automatic GLSL uniform representing a 4x4 model transformation matrix that transforms model coordinates to world coordinates.
Example:
// GLSL declaration
uniform mat4 czm_model;
// Example
vec4 worldPosition = czm_model * modelPosition;
An automatic GLSL uniform representing a 4x4 model-view transformation matrix that transforms model coordinates to eye coordinates.
Positions should be transformed to eye coordinates using
czm_modelView
and normals should be transformed using czm_normal.Example:
// GLSL declaration
uniform mat4 czm_modelView;
// Example
vec4 eyePosition = czm_modelView * modelPosition;
// The above is equivalent to, but more efficient than:
vec4 eyePosition = czm_view * czm_model * modelPosition;
An automatic GLSL uniform representing a 4x4 model-view transformation matrix that transforms 3D model coordinates to eye coordinates. In 3D mode, this is identical to czm_modelView, but in 2D and Columbus View it represents the model-view matrix as if the camera were at an equivalent location in 3D mode. This is useful for lighting 2D and Columbus View in the same way that 3D is lit.
Positions should be transformed to eye coordinates using
czm_modelView3D
and normals should be transformed using czm_normal3D.Example:
// GLSL declaration
uniform mat4 czm_modelView3D;
// Example
vec4 eyePosition = czm_modelView3D * modelPosition;
// The above is equivalent to, but more efficient than:
vec4 eyePosition = czm_view3D * czm_model * modelPosition;
An automatic GLSL uniform representing a 4x4 model-view-projection transformation matrix that transforms model coordinates to clip coordinates. Clip coordinates is the coordinate system for a vertex shader's
gl_Position
output. The projection matrix places the far plane at infinity. This is useful in algorithms like shadow volumes and GPU ray casting with proxy geometry to ensure that triangles are not clipped by the far plane.Example:
// GLSL declaration
uniform mat4 czm_modelViewInfiniteProjection;
// Example
vec4 gl_Position = czm_modelViewInfiniteProjection * modelPosition;
// The above is equivalent to, but more efficient than:
gl_Position = czm_infiniteProjection * czm_view * czm_model * modelPosition;
An automatic GLSL uniform representing a 4x4 model-view-projection transformation matrix that transforms model coordinates to clip coordinates. Clip coordinates is the coordinate system for a vertex shader's
gl_Position
output.Example:
// GLSL declaration
uniform mat4 czm_modelViewProjection;
// Example
vec4 gl_Position = czm_modelViewProjection * modelPosition;
// The above is equivalent to, but more efficient than:
gl_Position = czm_projection * czm_view * czm_model * modelPosition;
An automatic GLSL uniform representing a 4x4 model-view-projection transformation matrix that transforms model coordinates, relative to the eye, to clip coordinates. Clip coordinates is the coordinate system for a vertex shader's
gl_Position
output. This is used in conjunction with czm_translateRelativeToEye.Example:
// GLSL declaration
uniform mat4 czm_modelViewProjectionRelativeToEye;
// Example
attribute vec3 positionHigh;
attribute vec3 positionLow;
void main()
{
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
An automatic GLSL uniform representing a 4x4 model-view transformation matrix that transforms model coordinates, relative to the eye, to eye coordinates. This is used in conjunction with czm_translateRelativeToEye.
Example:
// GLSL declaration
uniform mat4 czm_modelViewRelativeToEye;
// Example
attribute vec3 positionHigh;
attribute vec3 positionLow;
void main()
{
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
gl_Position = czm_projection * (czm_modelViewRelativeToEye * p);
}
An automatic GLSL uniform representing the normalized direction to the moon in eye coordinates. This is commonly used for directional lighting computations.
Example:
// GLSL declaration
uniform vec3 czm_moonDirectionEC;
// Example
float diffuse = max(dot(czm_moonDirectionEC, normalEC), 0.0);
An automatic GLSL uniform representing the current morph transition time between 2D/Columbus View and 3D, with 0.0 being 2D or Columbus View and 1.0 being 3D.
Example:
// GLSL declaration
uniform float czm_morphTime;
// Example
vec4 p = czm_columbusViewMorph(position2D, position3D, czm_morphTime);
An automatic GLSL uniform representing a 3x3 normal transformation matrix that transforms normal vectors in model coordinates to eye coordinates.
Positions should be transformed to eye coordinates using czm_modelView and normals should be transformed using
czm_normal
.Example:
// GLSL declaration
uniform mat3 czm_normal;
// Example
vec3 eyeNormal = czm_normal * normal;
An automatic GLSL uniform representing a 3x3 normal transformation matrix that transforms normal vectors in 3D model coordinates to eye coordinates. In 3D mode, this is identical to czm_normal, but in 2D and Columbus View it represents the normal transformation matrix as if the camera were at an equivalent location in 3D mode. This is useful for lighting 2D and Columbus View in the same way that 3D is lit.
Positions should be transformed to eye coordinates using czm_modelView3D and normals should be transformed using
czm_normal3D
.Example:
// GLSL declaration
uniform mat3 czm_normal3D;
// Example
vec3 eyeNormal = czm_normal3D * normal;
- czm_orthographicIn3D
An automatic GLSL uniform that indicates if the current camera is orthographic in 3D.
- czm_pass
An automatic GLSL uniform representing the current rendering pass.
Example:
// GLSL declaration
uniform float czm_pass;
// Example
if ((czm_pass == czm_passTranslucent) && isOpaque())
{
gl_Position *= 0.0; // Cull opaque geometry in the translucent pass
}
An automatic GLSL uniform representing a 4x4 projection transformation matrix that transforms eye coordinates to clip coordinates. Clip coordinates is the coordinate system for a vertex shader's
gl_Position
output.Example:
// GLSL declaration
uniform mat4 czm_projection;
// Example
gl_Position = czm_projection * eyePosition;
- czm_resolutionScale
An automatic GLSL uniform representing the ratio of canvas coordinate space to canvas pixel space.
Example:
uniform float czm_resolutionScale;
- czm_sceneMode
An automatic GLSL uniform representing the current SceneMode, expressed as a float.
Example:
// GLSL declaration
uniform float czm_sceneMode;
// Example
if (czm_sceneMode == czm_sceneMode2D)
{
eyeHeightSq = czm_eyeHeight2D.y;
}
An automatic GLSL uniform representing the normalized direction to the sun in eye coordinates. This is commonly used for directional lighting computations.
Example:
// GLSL declaration
uniform vec3 czm_sunDirectionEC;
// Example
float diffuse = max(dot(czm_sunDirectionEC, normalEC), 0.0);
An automatic GLSL uniform representing the normalized direction to the sun in world coordinates. This is commonly used for directional lighting computations.
Example:
// GLSL declaration
uniform vec3 czm_sunDirectionWC;
An automatic GLSL uniform representing the sun position in Columbus view world coordinates.
Example:
// GLSL declaration
uniform vec3 czm_sunPositionColumbusView;
An automatic GLSL uniform representing the sun position in world coordinates.
Example:
// GLSL declaration
uniform vec3 czm_sunPositionWC;
An automatic GLSL uniform representing a 3x3 rotation matrix that transforms from True Equator Mean Equinox (TEME) axes to the pseudo-fixed axes at the current scene time.
Example:
// GLSL declaration
uniform mat3 czm_temeToPseudoFixed;
// Example
vec3 pseudoFixed = czm_temeToPseudoFixed * teme;
An automatic GLSL uniform representing a 4x4 view transformation matrix that transforms world coordinates to eye coordinates.
Example:
// GLSL declaration
uniform mat4 czm_view;
// Example
vec4 eyePosition = czm_view * worldPosition;
An automatic GLSL uniform representing a 4x4 view transformation matrix that transforms 3D world coordinates to eye coordinates. In 3D mode, this is identical to czm_view, but in 2D and Columbus View it represents the view matrix as if the camera were at an equivalent location in 3D mode. This is useful for lighting 2D and Columbus View in the same way that 3D is lit.
Example:
// GLSL declaration
uniform mat4 czm_view3D;
// Example
vec4 eyePosition3D = czm_view3D * worldPosition3D;
An automatic GLSL uniform representing the position of the viewer (camera) in world coordinates.
An automatic GLSL uniform containing the viewport's
x
,y
,width
, andheight
properties in anvec4
'sx
,y
,z
, andw
components, respectively.Example:
// GLSL declaration
uniform vec4 czm_viewport;
// Scale the window coordinate components to [0, 1] by dividing
// by the viewport's width and height.
vec2 v = gl_FragCoord.xy / czm_viewport.zw;
An automatic GLSL uniform representing a 4x4 orthographic projection matrix that transforms window coordinates to clip coordinates. Clip coordinates is the coordinate system for a vertex shader's
gl_Position
output.This transform is useful when a vertex shader inputs or manipulates window coordinates as done by BillboardCollection.
Do not confuse czm_viewportTransformation with
czm_viewportOrthographic
. The former transforms from normalized device coordinates to window coordinates; the later transforms from window coordinates to clip coordinates, and is often used to assign togl_Position
.Example:
// GLSL declaration
uniform mat4 czm_viewportOrthographic;
// Example
gl_Position = czm_viewportOrthographic * vec4(windowPosition, 0.0, 1.0);
An automatic GLSL uniform representing a 4x4 transformation matrix that transforms normalized device coordinates to window coordinates. The context's full viewport is used, and the depth range is assumed to be
near = 0
andfar = 1
.This transform is useful when there is a need to manipulate window coordinates in a vertex shader as done by BillboardCollection. In many cases, this matrix will not be used directly; instead, czm_modelToWindowCoordinates will be used to transform directly from model to window coordinates.
Do not confuse
czm_viewportTransformation
with czm_viewportOrthographic. The former transforms from normalized device coordinates to window coordinates; the later transforms from window coordinates to clip coordinates, and is often used to assign togl_Position
.Example:
// GLSL declaration
uniform mat4 czm_viewportTransformation;
// Use czm_viewportTransformation as part of the
// transform from model to window coordinates.
vec4 q = czm_modelViewProjection * positionMC; // model to clip coordinates
q.xyz /= q.w; // clip to normalized device coordinates (ndc)
q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // ndc to window coordinates
An automatic GLSL uniform representing a 4x4 view-projection transformation matrix that transforms world coordinates to clip coordinates. Clip coordinates is the coordinate system for a vertex shader's
gl_Position
output.Example:
// GLSL declaration
uniform mat4 czm_viewProjection;
// Example
vec4 gl_Position = czm_viewProjection * czm_model * modelPosition;
// The above is equivalent to, but more efficient than:
gl_Position = czm_projection * czm_view * czm_model * modelPosition;
An automatic GLSL uniform representing a 3x3 view rotation matrix that transforms vectors in world coordinates to eye coordinates.
Example:
// GLSL declaration
uniform mat3 czm_viewRotation;
// Example
vec3 eyeVector = czm_viewRotation * worldVector;
An automatic GLSL uniform representing a 3x3 view rotation matrix that transforms vectors in 3D world coordinates to eye coordinates. In 3D mode, this is identical to czm_viewRotation, but in 2D and Columbus View it represents the view matrix as if the camera were at an equivalent location in 3D mode. This is useful for lighting 2D and Columbus View in the same way that 3D is lit.
Example:
// GLSL declaration
uniform mat3 czm_viewRotation3D;
// Example
vec3 eyeVector = czm_viewRotation3D * worldVector;
内置常量
这里常量和函数的定义,在cesium官网的一个历史文档里有描述,后来版本的文档里没有了。
https://cesiumjs.org/releases/b28/Documentation/index.html
点击glsl,可以看到。
- czm_degreesPerRadian
- czm_depthRange
- czm_epsilon1
- czm_epsilon6
- czm_epsilon7
- czm_infinity
- czm_oneOverPi
- czm_oneOverTwoPi
- czm_passCesium3DTile
- czm_passCesium3DTileClassification
- czm_passCesium3DTileClassificationIgnoreShow
- czm_passClassification
- czm_passCompute
- czm_passEnvironment
- czm_passGlobe
- czm_passOpaque
- czm_passOverlay
- czm_passTerrainClassification
- czm_passTranslucent
- czm_pi
- czm_piOverFour
- czm_piOverSix
- czm_piOverThree
- czm_piOverTwo
- czm_radiansPerDegree
- czm_sceneMode
- czm_sceneMode2D
- czm_sceneModeColumbusView
- czm_sceneModeMorphing
- czm_solarRadius
- czm_threePiOver2
- czm_twoPi
- czm_webMercatorMaxLatitude
内置结构体定义
- czm_depthRangeStruct
- czm_ellipsoid
- czm_material
- czm_materialInput
- czm_ray
- czm_raySegment
- czm_shadowParameters
内置函数
czm_alphaWeight
- czm_antialias
- czm_approximateSphericalCoordinates
- czm_branchFreeTernary
- czm_cascadeColor
- czm_cascadeDistance
- czm_cascadeMatrix
- czm_cascadeWeights
- czm_columbusViewMorph
- czm_computePosition
- czm_cosineAndSine
- czm_decompressTextureCoordinates
- czm_depthClampFarPlane
- czm_eastNorthUpToEyeCoordinates
- czm_ellipsoidContainsPoint
- czm_ellipsoidNew
- czm_ellipsoidWgs84TextureCoordinates
- czm_equalsEpsilon
- czm_eyeOffset
- czm_eyeToWindowCoordinates
- czm_fastApproximateAtan
- czm_fog
- czm_gammaCorrect
- czm_geodeticSurfaceNormal
- czm_getDefaultMaterial
- czm_getLambertDiffuse
- czm_getSpecular
- czm_getWaterNoise
- czm_getWgs84EllipsoidEC
- czm_HSBToRGB
- czm_HSLToRGB
- czm_hue
- czm_inverseGamma
- czm_isEmpty
- czm_isFull
- czm_latitudeToWebMercatorFraction
- czm_lineDistance
- czm_luminance
- czm_metersPerPixel
- czm_modelToWindowCoordinates
- czm_multiplyWithColorBalance
- czm_nearFarScalar
- czm_octDecode
- czm_packDepth
- czm_phong
- czm_planeDistance
- czm_pointAlongRay
- czm_rayEllipsoidIntersectionInterval
- czm_readDepth
- czm_reverseLogDepth
- czm_RGBToHSB
- czm_RGBToHSL
- czm_RGBToXYZ
- czm_sampleOctahedralProjection
- czm_saturation
- czm_shadowDepthCompare
- czm_shadowVisibility
- czm_signNotZero
- czm_sphericalHarmonics
- czm_tangentToEyeSpaceMatrix
- czm_transformPlane
- czm_translateRelativeToEye
- czm_translucentPhong
- czm_transpose
- czm_unpackDepth
- czm_unpackFloat
- czm_vertexLogDepth
- czm_windowToEyeCoordinates
- czm_writeDepthClampedToFarPlane
- czm_writeLogDepth
- czm_XYZToRGB
原文:https://www.cnblogs.com/wanghui2011/articles/10870294.html
CESIUM内置shader变量和函数[转]的更多相关文章
- osg内置shader变量
uniform int osg_FrameNumber:当前OSG程序运行的帧数: uniform float osg_FrameTime:当前OSG程序的运行总时间: uniform float o ...
- Unity 内置Shader变量、辅助函数等
一:标准库里的常用.cginc文件 HLSLSupport.cginc - (automatically included) Helper macros and definitions for cro ...
- GLSL语言内置的变量详解
GLSL语言内置的变量,包括内置的顶点属性(attribute).一致变量(uniform).易变变量(varying)以及常量(const),一方面加深印象,另一方面今天的文章可以为以后的编程做查询 ...
- Python内置的字符串处理函数整理
Python内置的字符串处理函数整理 作者: 字体:[增加 减小] 类型:转载 时间:2013-01-29我要评论 Python内置的字符串处理函数整理,收集常用的Python 内置的各种字符串处理 ...
- Flask内置URL变量转换器
Flask内置URL变量转换器: 转换器通过特定的规则执行,”<转换器: 变量名>”.<int: year>把year的值转换为证书,因此我们可以在视图函数中直接对year变量 ...
- python内置常用高阶函数(列出了5个常用的)
原文使用的是python2,现修改为python3,全部都实际输出过,可以运行. 引用自:http://www.cnblogs.com/duyaya/p/8562898.html https://bl ...
- PHP内置的字符串处理函数
字符串的特点 1.其他类型的数据用在字符串类型处理函数中,会自动将其转化成字符串后,在处理 <?php echo substr("abcdefghijklmn",2,4 ...
- thinkPHP内置字符串截取msubstr函数用法详解
作者:陈达辉 字体:[增加 减小] 类型:转载 时间:2016-11-15 我要评论 这篇文章主要介绍了thinkPHP内置字符串截取函数用法,结合实例形式分析了thinkPHP内置的字符串截取函数功 ...
- unity, 查看内置shader源码
1,建一个球体. 2,建一个材质,将材质拖到球体上. 3,在材质的shader下拉列表中选择想查看的内置shader,点材质栏右上设置按钮->Select Shader 进入shader面板. ...
随机推荐
- 使用ranger替代资源浏览器
使用方法参考,这个是比较高校的: http://www.mikewootc.com/wiki/linux/usage/ranger_file_manager.html
- 服务接口,选择rpc还是http?
从通信内容/功能上看 http应用于web环境,rpc应用于分布式调度从功能上看没有太大区别,很多情况下rpc与消息中间件结合通信实现分布式调度 从用法上看两者都是c/s结构,无太大区别 从实现上看类 ...
- MyBatis之Oracle、Mysql批量插入
Mybatis中Dao层 public interface UsersMapper { public void insertEntitys(List<UserEntity> users); ...
- 实现多层DIV叠加的js事件穿透
前几天做的一个功能:在地图上加载标注,这个标注是列表,就直接放的 DIV. 后来发现,当鼠标在这个标注上面的时候,滚动鼠标滚轮,地图的缩放功能失效. 想了下,应该是最上面的标注 DIV 拦截了滚轮滚动 ...
- IDEA使用入门设置(从入门到放弃)
激活 1:设置JDK路径 2:设置maven环境 3:设置tomcat 4:设置快捷键与eclipse相同 4.1:设置字体大小 5:创建maven java 工程并进行编译打包等操作 6:创建 ...
- Linux 物理机虚拟化
前言 我有一台安装了 RHCA 资源的磁盘,然而每次开机时需要切换启动项为该磁盘.于是我想将它实现物理虚拟化. 工具 Windows 10 RHCA Disk Virtualbox 5.1 Virtu ...
- c99的新功能
在ANSI的标准确立后,C语言的规范在一段时间内没有大的变动,然而C++在自己的标准化创建过程中继续发展壮大.<标准修正案一>在1994年为C语言创建了一个新标准,但是只修正了一些C89标 ...
- 解决 spring boot 线程中使用@Autowired注入Bean的方法,报java.lang.NullPointerException异常
问题描述 在开发中,因某些业务逻辑执行时间太长,我们常使用线程来实现.常规服务实现类中,使用 @Autowired 来注入Bean,来调用其中的方法.但如果在线程类中使用@Autowired注入的Be ...
- DBUtils框架ResultSetHandler接口学习
今儿在学习spring框架的时候,让我想起来之前做项目时一直搁置的一个问题,就是DBUtils框架的做数据库操作的使用,当时制作项目的时候就是通过实例打了一遍,由于时间原因也并没有仔细去了解这一方面. ...
- PHPstorm不停Indexing最新解决办法
PHPstorm不停Indexing最新解决办法 1.网络上千篇一律的解决办法 File -> Invalidate Caches / Restart... -> Invalidate ...