Meta tags:
Headings (most frequently used words):
2011, 2010, optix, thursday, saturday, march, prey, and, april, tuesday, may, blog, for, trailer, instant, radiosity, using, rendering, water, graphics, runner, pages, february, 2012, june, monday, 28, 19, 15, august, wednesday, 10, about, me, blogs, links, tags, archive, search, this, net, managed, wrapper, nvidia, new, e3, concept, screenshot, deferred, with, teaser, animating, flow, maps, volume, 202, shadows, translucency, ground, control, to, major, tom, your, monies,
Text of the page (most frequently used words):
the (262), and (92), optix (59), ray (54), that (51), for (42), this (41), geometry (37), with (30), create (30), new (29), will (29), context (28), light (27), program (27), flow (26), our (25), you (25), vpls (25), from (24), here (23), float3 (20), water (17), are (17), map (17), buffer (17), prd_radiance (17), have (16), scene (16), float (15), index (15), prey (14), direct (14), material (14), net (13), posted (13), can (13), lighting (13), radiance (13), rendering (12), kyle (12), sample (12), get (12), vpl (12), seed (12), been (11), hayward (11), last (11), direction (11), indirect (11), set (11), format (11), instant (10), radiosity (10), depth (10), use (10), time (10), there (10), using (10), need (10), cast (10), rays (10), bufferdesc (10), camera (9), your (9), now (9), but (9), demo (9), lights (9), data (9), programs (9), buffers (9), acceleration (9), 2011 (8), nvidia (8), com (8), volume (8), tracing (8), normal (8), graphics (8), first (8), also (8), labels (8), shader (8), comments (8), was (8), texture (8), each (8), pixel (8), vector (8), when (8), source (8), tex2d (8), launch (8), node (8), type (8), width (8), post (7), point (7), creating (7), only (7), into (7), maps (7), offset (7), tex0 (7), generation (7), bounce (7), launch_dim (7), launch_index (7), instance (7), uint (7), april (6), may (6), 2010 (6), siggraph (6), game (6), couple (6), good (6), simple (6), many (6), has (6), these (6), working (6), some (6), pretty (6), what (6), results (6), based (6), then (6), them (6), cycle (6), next (6), flowmap (6), http (6), main (6), intersection (6), once (6), any (6), number (6), gpu (6), prd (6), count (6), buffertype (6), blog (5), march (5), xna (5), mapping (5), head (5), part (5), since (5), left (5), one (5), current (5), little (5), layer (5), out (5), halfcycle (5), would (5), float2 (5), trailer (5), photon (5), grid (5), its (5), lightsource (5), int (5), how (5), structure (5), bvh (5), output (5), input (5), outputbuffer (5), ref (5), accel (5), june (4), managed (4), human (4), deferred (4), level (4), model (4), work (4), about (4), top (4), project (4), fix (4), around (4), basic (4), order (4), pixels (4), idea (4), similar (4), much (4), week (4), find (4), coordinates (4), another (4), normals (4), phase0 (4), flowmapoffset0 (4), phase1 (4), normalt0 (4), texscale (4), normalt1 (4), flowlerp (4), comes (4), all (4), diffuse (4), virtual (4), merged (4), give (4), responsible (4), packet (4), add (4), renderer (4), eye (4), run (4), intensity (4), cell (4), origin (4), rnd (4), sdk (4), entry (4), hold (4), height (4), geogroup (4), setdata (4), toarray (4), february (3), august (3), wrapper (3), 2012 (3), software (3), shadow (3), pinhole (3), impostors (3), gpgpu (3), global (3), illumination (3), directx (3), cuda (3), animation (3), cli (3), programming (3), view (3), programmer (3), got (3), posts (3), xbox (3), saturday (3), over (3), should (3), finally (3), taking (3), space (3), volumes (3), sorted (3), not (3), draw (3), image (3), translucency (3), fairly (3), very (3), value (3), perform (3), does (3), say (3), shadows (3), thursday (3), talk (3), could (3), want (3), color (3), lets (3), dragon (3), render (3), interpolated (3), see (3), code (3), lerp (3), two (3), which (3), case (3), cycleoffset (3), cornell (3), later (3), bounces (3), other (3), voxel (3), merge (3), following (3), called (3), traverse (3), call (3), box (3), photons (3), oriented (3), make (3), rttrace (3), closest (3), download (3), virtualpointlight (3), position (3), mvpls (3), pos (3), rt_object_to_world (3), top_object (3), hit (3), library (3), vertex (3), geometryinstance (3), hierarchy (3), local (3), geometrygroup (3), compile (3), samples (3), optixdotnet (3), mindices (3), vbuffer (3), nbuffer (3), tcbuffer (3), ibuffer (3), july (2), january (2), casting (2), opengl (2), general (2), intel (2), visual (2), computing (2), gamasutra (2), gamedev (2), blogs (2), links (2), games (2), advances (2), look (2), developer (2), running (2), empty (2), angle (2), online (2), home (2), comment (2), weeks (2), who (2), actually (2), required (2), sorry (2), anyone (2), awhile (2), accepted (2), tech (2), ramblings (2), off (2), really (2), lead (2), why (2), language (2), blending (2), paper (2), year (2), must (2), record (2), anyhow (2), bugs (2), past (2), coming (2), needed (2), sort (2), back (2), subvolumes (2), alpha (2), artifacts (2), correct (2), ensure (2), prepass (2), right (2), either (2), variance (2), among (2), presentations (2), valve (2), implemented (2), scrolling (2), problem (2), looks (2), came (2), mid (2), contain (2), directions (2), varying (2), alter (2), previous (2), demonstrate (2), effect (2), did (2), after (2), distortion (2), reset (2), every (2), fading (2), where (2), visualize (2), phase (2), fully (2), pulsing (2), notice (2), anything (2), flowmaps (2), flowmapoffset1 (2), wavemaps0 (2), wavemaps1 (2), abs (2), uncompress (2), html (2), tuesday (2), monday (2), teaser (2), few (2), shots (2), sponza (2), than (2), introduction (2), won (2), entirely (2), too (2), algorithm (2), placing (2), through (2), roulette (2), intersections (2), same (2), divide (2), dramatically (2), shows (2), api (2), overview (2), essentially (2), intersects (2), dimensions (2), tracer (2), hemisphere (2), setup (2), piece (2), recursively (2), created (2), generate (2), done (2), candy (2), typical (2), red (2), onto (2), floor (2), bounced (2), build (2), least (2), show (2), toggle (2), optixinstantradiosity (2), mcontext (2), sqrtnumvpls (2), mboundingbox (2), mfirstleafindex (2), numlights (2), size (2), d3dxvector3 (2), continue (2), zero (2), sure (2), start (2), output_vpls (2), pointer (2), rt_program (2), world_shading_normal (2), normalize (2), rttransformnormal (2), world_geometric_normal (2), ffnormal (2), hit_point (2), t_hit (2), texcoord (2), lightpos (2), maxbounces (2), seed_direction (2), make_float2 (2), new_ray_dir (2), generatehemispherelightphoton (2), new_ray (2), radiance_ray_type (2), scene_epsilon (2), surface (2), more (2), less (2), calculate (2), convert (2), void (2), rayseed (2), random (2), bethesda (2), screenshot (2), concept (2), today (2), released (2), wrappers (2), line (2), moment (2), such (2), guide (2), trace (2), tells (2), entrypointcount (2), sets (2), creates (2), surfaceprogram (2), d3d (2), variables (2), optimize (2), traversal (2), split (2), built (2), sbvh (2), used (2), memory (2), display (2), codeplex (2), stream (2), desc (2), raygen (2), index_buffer (2), vertex_buffer (2), vdesc (2), mvertices (2), ndesc (2), mnormals (2), tcdesc (2), mtexcoords (2), idesc (2), int3 (2), vector3 (2), runner (2), powered, blogger, search, october, november, 2008, 2009, archive, amazon, widgets, wii, vsm, volumetric, clouds, terrain, ssgi, ssao, smoke, scientific, visualization, refractions, reflections, processing, pcf, particle, effects, parallax, occlusion, o3d, non, fog, fluid, dynamics, fire, eurographics, dual, paraboloid, field, bloom, atmospheric, scattering, tags, xnainfo, wiki, creators, riemers, meeting, tutorials, kylehayward, portfolio, miles, macklin, radioactive, randomchaos, detail, journal, ysaneya, treatise, innovative, jonas, risbrandt, physics, michael, abrash, larrabee, instructions, lrbni, marco, salvi, sql, server, xml, schouviller, salaries, revisited, christer, ericson, viewmodel, mvvm, copypastepixel, xapparse, five, years, pandemonium, win2d, team, engineering, process, shawn, hargreaves, casinos, australia, rise, digital, gambling, entertainment, david, weller, variable, sized, graphic, rants, complete, profile, tiburon, interested, ever, n64, follow, flickr, twitter, subscribe, atom, older, email, ago, someone, put, component, description, indie, marketplace, spirit, fighter, pilot, missiles, unlock, fighters, along, way, warning, missile, escape, indies, flying, evade, maximinus, monies, commented, hasn, spammed, bots, job, interactive, paid, excited, smart, talented, people, cool, thanks, slick, play, ideas, absent, lately, spring, recruited, american, sign, teaching, purdue, university, ranged, database, implementation, layered, skeletal, additive, support, facial, compiler, asl, scripts, antlr, amazing, education, section, wow, sound, like, broken, had, installment, soon, ground, control, major, tom, wednesday, finishing, even, visiting, page, anymore, better, sanity, optimizations, being, pseudo, skipping, noted, completely, sub, front, respect, distance, insures, smooth, framerate, matter, speedup, moved, degrees, because, depending, drawn, pass, contribute, final, includes, approximated, far, realistic, gives, compare, exponential, falloff, latter, isn, below, uses, well, anticlimactic, wasn, 202, attended, they, dead, portal, plane, ride, whipped, remember, edit, standard, technique, animated, previously, written, unnatural, uniformly, move, viz, 90s, representing, allows, velocity, length, instead, minutes, photoshop, designed, column, note, greatly, exaggerated, coordinate, become, distorted, stretched, nasty, filtering, solve, limit, amount, resetting, solves, seconds, introduce, half, while, beginning, diagram, layers, graph, illustrates, during, above, unwrap, stored, fetch, between, however, subtle, affect, couldn, rendered, included, completeness, perturb, noise, update, slides, video, waterflow, noisemaps, realtimerendering, s2010, animating, keeping, busy, announced, www, g4tv, videos, 51782, debut, exclusive, premiere, 360, days, writeup, obligatory, scenes, wanted, hadn, factored, crysis, quite, decided, large, cover, long, just, parts, approximates, act, russian, killed, optimization, makes, regular, together, form, represents, voxels, don, skipped, reduces, trades, accuracy, speed, calculated, runs, gpus, g80, giving, take, things, gets, exactly, sounds, generates, shading, classic, computation, down, business, room, area, ceiling, randomly, collect, traverses, providing, hits, updating, deciding, under, maximum, both, gather, merging, shot, bleeding, green, walls, draperies, ambient, boost, 8800, series, computer, compliant, files, interest, optixentity, cpp, instantradiosity, controls, requiring, skydrive, limits, file, sizes, 50mb, assets, notes, getbuffer, mmergevpls, totalvpls, aabb, findcellindex, mvoxelextent, assert, lastindex, dot, mvoxels, center, light_point, getcolorvalue, vector3zero, addindirectlight, mlightmodel, addlightsource, const, subtract, leaf, found, valid, root, belongs, block, merges, scattered, structured, helps, reduce, static_cast, closest_hit_radiosity, shading_normal, geometric_normal, faceforward, norm_rgb, diffusetex, pow3f, make_float3, diffusecolor, rotate, seeds, return, implement, russion, biased, solution, max, shoot, equal, divided, equally, starts, bit, multiply, linear, hitpoint, provided, transformation, world, instant_radiosity, seed_buffer, perraydata_radiance, indirectintensity, uint2, williams, edu, papers, optixsiggraph10, fullviewmedia, siggraph2010, dev, austin, robison, raytracing, bethblog, php, sneak, peek, gonna, lie, awesome, open, lightweight, figured, aren, ahead, myself, started, curiosity, learning, experience, still, stage, development, suggestions, feel, free, drop, math, sparse, having, functions, cudafy, downside, cannot, share, structs, classes, original, framework, applications, obj, loader, talked, recommend, quick, let, small, tutorial, walk, steps, cow, shade, different, types, traversing, etc, assigns, propery, sorting, loaded, brevehity, sake, omitted, important, fill, positions, triangle, indices, tell, primitives, pairs, earlier, bounding, spatial, builder, traverser, informs, traversed, name, building, assigning, names, triangkekdtree, accelbuilders, begin, creation, making, define, defines, buffertypes, inputoutput, three, self, explanatory, live, huge, performance, win, multi, setups, doesn, require, copying, typically, intermediate, accumulation, iterative, validate, layout, tree, needs, initialization, changes, doing, executables, freely, downloadable, currently, mimic, test, functionality, release, directly, mercurial, https, hg01, gldrawpixels, gl_bgra, gl_unsigned_byte, datapointer, unmap, bufferstream, displaying, buildacceltree, output_buffer, ubyte4, raygenpath, setraygenerationprogram, pinhole_camera, addchild, attach, group, addmaterial, vertexbuffername, indexbuffername, acceltraverser, accelbuilder, intersectionprogram, intersecitonprogpath, intersecitonprogname, boundingboxprogram, boundingboxprogpath, boundingboxprogname, primitivecount, texcoord_buffer, normal_buffer, vector2, descriptions, shaderpath, closest_hit_radiance, rayhittype, raytypecount, load, performing, akin, shaders, device, pages, delusions,
Text of the page (random words):
or when geometry changes context top_object set model geogroup context output_buffer set outputbuffer context compile context buildacceltree ray tracing and displaying results to ray trace the scene we call launch and give the size of our 2d launch dimensions and the index of our main entry program zero context launch 0 width height and to display the results we get a pointer to the output buffer and we use opengl s draw pixels bufferstream stream outputbuffer map gl gldrawpixels width height gl gl_bgra gl gl_unsigned_byte stream datapointer outputbuffer unmap results and that s pretty much it a pretty simple program for doing gpu ray tracing the current source samples and built executables are freely downloadable currently i ve got 5 samples that mimic the optix sdk samples and will continue to add more to test functionality and eye candy you can download the current release and source here http optixdotnet codeplex com or get the source directly with mercurial here https hg01 codeplex com optixdotnet posted by kyle hayward at 8 45 pm no comments labels c c cli cuda gpgpu optix optix net ray tracing saturday june 4 2011 new prey 2 e3 trailer bethesda released a new trailer for prey 2 i m not gonna lie it looks awesome posted by kyle hayward at 8 56 pm no comments labels prey 2 thursday april 7 2011 prey 2 concept and screenshot bethesda posted a screenshot and concept piece from prey 2 today http bethblog com index php 2011 04 07 sneak peek at prey 2 posted by kyle hayward at 3 10 pm no comments labels prey 2 monday march 28 2011 instant radiosity using optix and deferred rendering this comes a little later than i wanted i hadn t factored in crysis 2 taking up as much of my time as it did last week i ve been using nvidia s optix raytracing api for quite some time and decided that a good introduction to optix and what it can do for you would be using it in an instant radiosity demo the demo is fairly large so i won t cover all of it here as that would be entirely too long of a post but just the main parts instant radiosity instant radiosity is a global illumination algorithm that approximates the diffuse radiance of a scene by placing many virtual point lights that act as indirect light the algorithm is fairly simple for each light in the scene you cast n photon rays into the scene at each intersection the photon either bounces and another ray is cast or through russian roulette is killed of at each of the intersections you create a virtual point light vpl that has the same radiance value as the photon once you have these vpls you render them as you would any other light source one optimization that the demo makes is to divide the scene into a regular grid for each grid voxel we find all the vpls in the voxel and merge them together to form a new vpl that represents the merged vpls any voxels that don t contain any vpls are skipped this dramatically reduces the number of vpls that we need to render and trades off indirect accuracy for speed the following couple of shots demonstrate this idea the image on the left shows the vpls as calculated from our optix program the image on the right shows the merged vpls optix optix is nvidia s ray tracing api that runs on nvidia gpus on g80 and up giving an overview to optix could take many blog posts so i won t go that in depth here there are a couple of siggraph presentations that give a good overview http nvidia fullviewmedia com siggraph2010 04 dev austin robison html http graphics cs williams edu papers optixsiggraph10 to create an optix program you essentially need two things a ray generation program and a material program essentially a shader that gets called when a ray intersects geometry the ray generation program does exactly as it sounds it generates rays the program is called for each pixel of your program s dimensions rays cast by your ray generation program will traverse the scene for intersections once a ray intersects geometry it will call its material program the material program is responsible for say shading in a classic ray tracer or any other computation you want to perform in our case we ll use it to create our virtual point lights so lets get down to business here we have the ray generation program that will cast rays from a light in the case of our cornell box room we have an area light at the ceiling and we need to cast photons from this light rt_program void instant_radiosity get our random seed uint2 seed seed_buffer launch_index create a random photon direction float2 rayseed make_float2 float launch_index x rnd seed x float launch_dim x float launch_index y rnd seed y float launch_dim y float3 origin light position float3 direction generatehemispherelightphoton rayseed light direction create our ray optix ray ray origin direction radiance_ray_type scene_epsilon create our ray data packet and launch a ray perraydata_radiance prd prd radiance light color light intensity indirectintensity prd bounce 0 prd seed seed prd index launch_index y launch_dim x launch_index x maxbounces rttrace top_object ray prd so here we cast a randomly oriented ray from a hemisphere oriented about the direction of the light once we have our ray we setup a ray data packet that will collect data as this ray traverses the scene to cast the ray we make a call to rttrace providing the ray and its data packet next we have our material program this program is called when a ray hits the closest piece of geometry from the light and it is responsible for updating the ray data packet placing a vpl and deciding to cast another ray recursively if we re under the maximum number of bounces rt_program void closest_hit_radiosity convert the geometry s normal to world space rt_object_to_world is an optix provided transformation float3 world_shading_normal normalize rttransformnormal rt_object_to_world shading_normal float3 world_geometric_normal normalize rttransformnormal rt_object_to_world geometric_normal float3 ffnormal faceforward world_shading_normal ray direction world_geometric_normal calculate the hitpoint of the ray float3 hit_point ray origin t_hit ray direction sample the texture for the geometry float3 kd norm_rgb tex2d diffusetex texcoord x texcoord y kd pow3f kd 2 2f convert to linear space kd make_float3 diffusecolor multiply the diffuse material color prd_radiance radiance kd prd_radiance radiance calculate the ray s new radiance value we hit a diffuse surface record hit if it has bounced at least once if prd_radiance bounce 0 offset the light a bit from the hit point float3 lightpos ray origin t_hit 0 1f ray direction virtualpointlight vpl output_vpls prd_radiance index prd_radiance bounce vpl position lightpos the light s intensity is divided equally among the photons each photon starts out with an intensity equal to the light so here we must divide by the number of photons cast from the light vpl radiance prd_radiance radiance 1 0f launch_dim x launch_dim y if we re less than the max number of bounces shoot another ray we could also implement russion roulette here so that we would have a less biased solution prd_radiance bounce if prd_radiance bounce maxbounces return here we rotate the seeds in order to have a little more variance prd_radiance seed x prd_radiance seed x prd_radiance bounce prd_radiance seed y prd_radiance seed y prd_radiance bounce float2 seed_direction make_float2 float launch_index x rnd prd_radiance seed x float launch_dim x float launch_index y rnd prd_radiance seed y float launch_dim y generate a new ray in the hemisphere oriented to the surface float3 new_ray_dir generatehemispherelightphoton seed_direction ffnormal cast a new ray into the scene optix ray new_ray hit_point new_ray_dir radiance_ray_type scene_epsilon rttrace top_object new_ray prd_radiance with both of these programs created we need to launch our optix program in order to generate the vpls when we re done running the optix program we gather all the vpls into a grid merging lights that are in the same voxel once the vpls are merged we add them to the deferred renderer run our optix program mcontext launch 0 sqrtnumvpls sqrtnumvpls get a pointer to the gpu buffer of virtual point lights virtualpointlight lights static_cast virtualpointlight mcontext output_vpls getbuffer map the following block merges the scattered vpls into a structured grid of vpls this helps dramatically reduce the number of vpls we need in the scene if mmergevpls here we traverse over the vpls and we merge all the lights that are in a cell for int i 0 i totalvpls i optix aabb node mboundingbox start with the root cell and recursively traverse the grid to find the cell this vpl belongs to int index 0 if findcellindex mboundingbox 1 mvoxelextent lights i position index make sure we found a valid cell assert index mfirstleafindex subtract the first leaf index to find the zero based index of the vpl index mfirstleafindex float3 light mvpls index light lights i radiance once the vpls have been merged add them to the renderer as indirect lights int numlights 0 int lastindex 1 for int i 0 i mvpls size i const float3 vpl mvpls i if dot vpl vpl 0 0f continue numlights float3 radiance vpl d3dxvector3 pos d3dxvector3 mvoxels i center light light light_point type getcolorvalue radiance x radiance y radiance z 1 0f diffuse pos pos vector3zero direction 1 0f intensity renderer addindirectlight light also add as a light source so we can visualize the vpls lightsource lightsource lightsource light light lightsource model mlightmodel renderer addlightsource lightsource now for some eye candy the first set are your typical cornell box dragon in the instant radiosity shot you can see the light bleeding from the green and red walls onto the floor the dragon and the box direct lighting direct lighting indirect vpls direct lighting direct lighting indirect vpls the next set is from the sponza scene here too you can notice the red bounced light from the draperies onto the floor and in the ambient lighting in the shadows direct lighting direct lighting indirect vpls direct lighting direct lighting indirect vpls direct lighting direct lighting indirect vpls notes to build the demo you ll need boost 1 43 or later to run the demo you ll need at least an nvidia 8800 series or later anything computer 1 0 compliant files of interest are in the demo project optixentity cpp and instantradiosity cu controls show vpls l toggle gi i toggle merge vpls m download sorry for requiring two download links but skydrive limits file sizes to 50mb optixinstantradiosity part 1 code optixinstantradiosity part 2 assets posted by kyle hayward at 2 58 am 9 comments labels cuda deferred rendering directx global illumination gpgpu instant radiosity optix ray tracing saturday march 19 2011 instant radiosity with optix i ve been working on a new sample for the past few days instant radiosity using optix and directx i should have a writeup and sample in the coming week here s a few shots with the obligatory cornell and sponza scenes direct lighting direct indirect vpls direct lighting direct indirect vpls posted by kyle hayward at 4 29 pm 1 comment tuesday march 15 2011 prey 2 teaser trailer human head has been keeping me busy since i ve been working there and i can finally say why prey 2 the game was announced on monday here s the prey 2 teaser trailer xbox 360 games e3 2011 prey 2 http www g4tv com videos 51782 prey 2 debut trailer exclusive premiere posted by kyle hayward at 8 11 pm 6 comments labels prey 2 tuesday august 3 2010 animating water using flow maps last week i attended siggraph 2010 and among the many good presentations valve game a talk on the simple water shader they implemented for left for dead 2 and portal 2 so on the plane ride back from la i whipped up this little sample from what i could remember of the talk edit you can find the talk here http advances realtimerendering com s2010 index html the standard technique for animated water is scrolling normal maps as i ve previously written about the problem with this is that it looks unnatural as water does not uniformly move in one direction so valve came up with the idea of using flow maps based on a flow viz paper from the mid 90s the basic idea of flow maps is that you create a 2d texture that you will map to your water and this map will contain the flow directions that you want the water to flow with each pixel in the flow map representing a flow vector this allows you to have varying velocity based on length of the flow vector and varying flow directions based on the color of the flow vector you then use this flow map to alter the texture coordinates of the normal maps instead of scrolling them lets get to work the flow map first we need to create a flow map here s what i came up with in a couple of minutes in photoshop this flow map was designed around the column with dragon scene as with the previous scene note this flow map is greatly exaggerated to demonstrate the effect using the flow map now we need to use the flow map to alter the water normal maps we do this by taking the texture coordinate of the current water pixel and offset it using the flow vector from the flow map based on a time offset we then render the water as we did in the previous water sample but there s a problem with this after awhile the texture coordinates will become so distorted that the normal maps will be stretched and will have nasty filtering artifacts so to solve this we limit the amount of distortion of the texture coordinates by resetting the time offset this solves the over distortion but now the water will reset every x seconds so we introduce another layer that is offset from the first by half a time cycle this will ensure that while one layer is fading out and beginning to reset the next layer is fading to where the last layer was here s a diagram to visualize this phase in phase out of the 2 layers the graph illustrates that during a cycle time from 0 to 1 we want the layer to be fully interpolated at the mid point in the cycle and fully un interpolated at 0 and 1 lets see the code get and uncompress the flow vector for this pixel float2 flowmap tex2d flowmaps tex0 rg 2 0f 1 0f float phase0 flowmapoffset0 float phase1 flowmapoffset1 sample normal map float3 normalt0 tex2d wavemaps0 tex0 texscale flowmap phase0 float3 normalt1 tex2d wavemaps1 tex0 texscale flowmap phase1 float flowlerp abs halfcycle flowmapoffset0 halfcycle float3 offset lerp normalt0 normalt1 flowlerp in the code above halfcycle would be 5 if our cycle was from 0 to 1 we can see here that we unwrap the flow vector as it is stored in 0 1 and we need it in 1 1 fetch the normals using the flow vector and then lerp between the two normals based on the cycle time this however will lead to a subtle pulsing affect which i couldn t really notice when the water was rendered but i included the fix for completeness to fix this pulsing effect we perturb the flow cycle at each pixel using a noise map get and uncompress the flow vector for this pixe...
|