cg

Unity Shader - How to efficiently recolor specific coordinates?

做~自己de王妃 提交于 2021-02-08 13:23:50
问题 First, please allow me to explain what I've got and then I'll go over what I'm trying to figure out next. What I've got I've got a textured custom mesh with some edges that exactly align with integer world coordinates in Unity. To the mesh I've added my own crude yet effective custom surface shader that looks like this: Shader "Custom/GridHighlightShader" { Properties { [HideInInspector]_SelectionColor("SelectionColor", Color) = (0.1,0.1,0.1,1) [HideInInspector]_MovementColor("MovementColor",

js网页显示时间

拟墨画扇 提交于 2020-03-08 09:13:03
<html> <title>当前时间</title> <body> <!-- 定义一个id为cg --> <span id="cg">2016/12/21 上午12:00:00</span> <script> <!--这个cg就是span的id,初始化Date时间并转化为字符 string类型,每1000毫秒,setInterval() 就会调用函数,直到 被关闭。--> setInterval("cg.innerHTML=new Date ().toLocaleTimeString('chinese', {hour12:false})",1000); </script> </body></html> 来源: https://www.cnblogs.com/apolloren/p/12440936.html

游戏中剧情动画CG实现的一种方式概述

霸气de小男生 提交于 2020-03-02 12:36:14
1.关于游戏中剧情动画CG的实现,有多种方式实现,这里我指出在之前的项目中我实现CG的一种方法。 2.多种实现方式的简述: a.使用预先制作好的动画Video文件,通过引擎接口,以流媒体的方式播放,就好比是内置电影一样。 比如:有story1.rmvb格式的动画文件,通过接口engine.playCG("story1", onStop)播放,其中onStop函数为播放结束时回调函数。 这种做法的优势是可以事先离屏渲染出及其精美的CG动画,劣势是玩家看到如此精美的CG但是实际游戏画面有很大落差会觉得游戏不够诚意,还有就是这种方法太过死板,CG过程中无法和玩家交互或者是无法根据游戏中的当前状态而有所变化。 b.在游戏场景编辑器中提供CG工具,编辑CG的镜头曲线,和CG中的游戏中静态物体的生成和消失。这种做法将CG动画保存为引擎中能够理解的一系列事件,比如镜头的移动,场景中的物体的生成等。 其格式比如: [camera curve time]-表示摄像机在time中按照curve曲线移动 [obj1 time1 obj2 time2 ...]-表示场景中obj1的物体(可以是骨骼动画,声音,特效等)的生命期为time1 这种做法属于内置游戏渲染,让玩家看CG时没有一种切出的感觉,表现出场景的一定的变迁。 3.我之前做上家公司游戏中的CG系统时,使用的是类似于b种方法,其做法是: 3-1

(How) can a shader view the current render-buffer?

拈花ヽ惹草 提交于 2020-01-30 09:12:06
问题 Is it possible for a pixel shader to see the current state of the depth/color/stencil buffer? 回答1: A fragment shader is not given the current buffer values for the fragment it is working on. Attempts to read these values, by using those buffers as textures, will not in the general case produce reasonable results. It's "undefined behavior." There are certain specific cases where it can work. First, you can use texture barriers. That is technically an NVIDIA extension, but ATI supports it

How to use 3d texture in opengl and cg shaders?

*爱你&永不变心* 提交于 2020-01-24 01:32:04
问题 I've got a problem with 3d texture mapping. If I have several 2d textures, and I want to build a 3d texture with these 2d textures. What can I do to put all these data together? The function glTexImage3D ends with a parameter const GLvoid *texels which leads to the data of the texture. But now I have 32 2D textures and want to get a 3D texture. How to do that? The second question is about image space filtering method. Is there anyone who knows what it is? I should use this method to determine

Basic openGL 3.2 Setup with lwjgl - Object not rendered

廉价感情. 提交于 2020-01-07 03:04:27
问题 I am little bit desperate here. I am trying to update/refactor an existing code written in legacy opengl to make use of the "modern way" of opengl version 3.2+. It is written in Java with lwjgl. I already stripped away most of the functionality to test the basic setup. For me at the moment it is really just about setting up the vbo with vertices loaded from an obj file and render it. My problem is, that the display window stays empty. If it would display me just something, I would be really

Basic openGL 3.2 Setup with lwjgl - Object not rendered

纵饮孤独 提交于 2020-01-07 03:04:07
问题 I am little bit desperate here. I am trying to update/refactor an existing code written in legacy opengl to make use of the "modern way" of opengl version 3.2+. It is written in Java with lwjgl. I already stripped away most of the functionality to test the basic setup. For me at the moment it is really just about setting up the vbo with vertices loaded from an obj file and render it. My problem is, that the display window stays empty. If it would display me just something, I would be really

How can i convert uv coordinates to world space?

偶尔善良 提交于 2019-12-24 09:24:09
问题 I am trying to implement a shader. It will use with Unity LineRenderer. Shader will have noise that scrolling overtime raltive to texture coordinates. For example in parallel to x axis of uv space of texture. I have an implementation, but i dont'know how to get direction relative to texture uv (consider the texture rotation) in a vert function. I am only have a world space-relativew scrolling. Main problem - how to convert uv coordinates (for example (0, 0) or (1, 0)) to world space? Here is

How can i convert uv coordinates to world space?

青春壹個敷衍的年華 提交于 2019-12-24 09:23:36
问题 I am trying to implement a shader. It will use with Unity LineRenderer. Shader will have noise that scrolling overtime raltive to texture coordinates. For example in parallel to x axis of uv space of texture. I have an implementation, but i dont'know how to get direction relative to texture uv (consider the texture rotation) in a vert function. I am only have a world space-relativew scrolling. Main problem - how to convert uv coordinates (for example (0, 0) or (1, 0)) to world space? Here is