Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#Actualrohezal

Posted 20 August 2013 - 03:16 PM

Hi guys,

 

I am doing a mod for a game. I can only change the shaders.

 

It is a billboard cloud (a quad which rotates with the camera and changes it's it texture depending on the viewing angle of the user). If you are at the front you see the dragon face front. If you are 90° degree to the left, the quad rotates and you see the dragonface fromt the left. I am doing this with one mega texture (8K*2K texel). It consists of 16*4 = 64  (512x512 pixel) images next to each other. It works ok smile.png.

 

It allready works in GL SL (open gl). I just move the UV coordinates to display a different part of texture (which is just one of the 512x512 images). When it just were 1x64 images the mapping would be easing 360° degree, so each the image to display would ucoord = ucoord/64 + (int)(angle/64) or something. Now I have 2D mapping and try to get from sin and cos the the degree. It works. Then map it a 16x4 image "array". It works.

 

But when I try to map it to direct x hlsl it fails. I don't know why. Maybe you have an idea.

 

If you want to try it:

 

Grid Shader (starts with  //own code it is a mod like I said):

http://pastebin.de/35908

 

Rotation only Shader (works):

http://pastebin.de/35909

 

The open gl gl sl shader (works):

http://pastebin.de/35910


#2rohezal

Posted 20 August 2013 - 03:16 PM

Hi guys,

 

I am doing a mod for a game. I can only change the shaders.

 

It is a billboard cloud (a quad which rotates with the camera and changes it's it texture depending on the viewing angle of the user). If you are at the front you see the dragon face front. If you are 90° degree to the left, the quad rotates and you see the dragonface fromt the left. I am doing this with one mega texture (8K*2K texel). It consists of 16*4 = 64  (512x512 pixel) images next to each other. It works ok smile.png.

 

It allready works in GL SL (open gl). I just move the UV coordinates to display a different part of texture (which is just one of the 512x512 images). When it just were 1x64 images the mapping be easing 360° degree, so each the image to display would ucoord = ucoord/64 + (int)(angle/64) or something. Now I have 2D mapping and try to get from sin and cos the the degree. It works. Then map it a 16x4 image "array". It works.

 

But when I try to map it to direct x hlsl it fails. I don't know why. Maybe you have an idea.

 

If you want to try it:

 

Grid Shader (starts with  //own code it is a mod like I said):

http://pastebin.de/35908

 

Rotation only Shader (works):

http://pastebin.de/35909

 

The open gl gl sl shader (works):

http://pastebin.de/35910


#1rohezal

Posted 20 August 2013 - 03:13 PM

Hi guys,

 

I am doing a mod for a game. I can only change the shaders.

 

It is a billboard cloud (a quad which rotates with the camera and changes it's it texture depending on the viewing angle of the user). If you at the front you see the dragon face front. If you 90° degree to the left, the quad rotates and you see the dragonface fromt the left. I am doing this with one mega texture (8K*2K texel). It consists of 16*4 = 64  (512x512 pixel) images next to each other. It works ok smile.png.

 

It allready works in GL SL (open gl). I just move the UV coordinates to display a different part of texture (which is just one of the 512x512 images). When it just were 1x64 images the mapping be easing 360° degree, so each the image to display would ucoord = ucoord/64 + (int)(angle/64) or something. Now I have 2D mapping and try to get from sin and cos the the degree. It works. Then map it a 16x4 image "array". It works.

 

But when I try to map it to direct x hlsl it fails. I don't know why. Maybe you have an idea.

 

If you want to try it:

 

Grid Shader (starts with  //own code it is a mod like I said):

http://pastebin.de/35908

 

Rotation only Shader (works):

http://pastebin.de/35909

 

The open gl gl sl shader (works):

http://pastebin.de/35910


PARTNERS