tag:blogger.com,1999:blog-9153918266310828368.post1131099003939679462..comments2023-05-15T06:31:27.649-07:00Comments on ReCreation Studios: CratersPatrickhttp://www.blogger.com/profile/11884568868011584937noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-9153918266310828368.post-84258029576436519122009-03-19T09:30:00.000-07:002009-03-19T09:30:00.000-07:00Well, the biggest problem you have is that you are...Well, the biggest problem you have is that you are not using your scaled texture coordinates (x, y, and z variables).<BR/><BR/>Your for loop should look more like this:<BR/><BR/>for (int i=0;i(octaves;i+=1)<BR/>(<BR/> sum += amp * tex3D(NoiseSamp,<BR/> float3(x, y, z)).x;<BR/> amp *= gain;<BR/> x *= lacunarity;<BR/> y *= lacunarity;<BR/> z *= lacunarity;<BR/>)Patrickhttps://www.blogger.com/profile/11884568868011584937noreply@blogger.comtag:blogger.com,1999:blog-9153918266310828368.post-39143271077808951682009-03-19T04:33:00.000-07:002009-03-19T04:33:00.000-07:00Hello, I'm a software engineer from Spain speciali...Hello, I'm a software engineer from Spain specialized in computer graphics development and I'm learning HLSL. I try to write a HLSL pixel shader for procedural textures and I started with fBm, but I haven't success. can u help me?<BR/><BR/>I started with 2D noise texture created in photoshop, I sample it in HLSL and then apply the fBm:<BR/><BR/>////////////////////////////<BR/>//fBm Pixel Shader<BR/>////////////////////////////<BR/>float sum = 0.0;<BR/>float amp = 1.0;<BR/> <BR/>float octaves = 2.0f;<BR/>float lacunarity = 2.0f;<BR/>float gain = 1.0f;<BR/> <BR/>float x = IN.UV.x;<BR/>float y = 0.f;<BR/>float z = IN.UV.z;<BR/> <BR/>for (int i=0;i(octaves;i+=1)<BR/>(<BR/> sum += amp * tex3D(NoiseSamp,<BR/> IN.WoodPos).x;<BR/> amp *= gain;<BR/> x *= lacunarity;<BR/> y *= lacunarity;<BR/> z *= lacunarity;<BR/>)<BR/> <BR/>float3 res = float3(sum, sum, sum);<BR/>return float4(res, 1.0f);<BR/><BR/><BR/>Is this correct? Where is the mistake?<BR/>Thanks in Advance.<BR/><BR/>Joel.Anonymoushttps://www.blogger.com/profile/13565673258197277939noreply@blogger.com