Shadow Mapping Using LWJGL And Shaders

Jun 25, 2014

I'm looking for a working example of shadow mapping with java code using shaders. There are so many c++ or c tutorials out there but i haven't managed to rewrite them since I'm too bad in c/c++. I've been trying to implement this a long time but can't get the hang of it. Any example out there? Preferably as sstripped down as possible except for the shadow mapping.

View Replies


ADVERTISEMENT

Text Ruined By Shadow Mapping

Jun 17, 2014

I'm working on a project and I'm just about to implement different stages (menus etc). The program is opened in an intro stage that just renders a text (slick, Unicode font) looking like this:

After switching to a different stage hat uses shadow mapping and then back to the intro stage it looks like this:

I've found that removing the line:

glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 0, 0, shadowMapWidth, shadowMapHeight, 0);

solves the problem but then the shadow mapping isn't working.

View Replies View Related

LWJGL Keyboard Inputs Not Recognized

May 10, 2014

I wanted to create a simple window with the LWJGL and a key input request which closes the window.I also wanted to create the classes in seperated packages, so it's more organized.The window displays but if I press that certain key nothing happens.Here is the Main class:

package bb.main;
import bb.input.Input;
import bb.main.render.SimpleRenderer;
public class Main {
public static void main(String[] args){
SimpleRenderer createWindow = new SimpleRenderer();
Inputinput= new Input();

[code]....

View Replies View Related

LWJGL - Blurry Images When Rendered

Jan 20, 2014

I wanted to use 16x16 pixel images in my game to make it look more "pixely", but the images get really blurry when they're rendered. How do I make them clearer?

Java Code:

import static org.lwjgl.opengl.GL11.*;
import org.lwjgl.opengl.*;
import org.lwjgl.*;
import org.lwjgl.input.Mouse;
import org.lwjgl.input.Keyboard;
import org.newdawn.slick.opengl.Texture;
import org.newdawn.slick.opengl.TextureLoader;
import java.io.*;
public class Test{
int DISPLAY_WIDTH = 1000, DISPLAY_HEIGHT = 500;

[Code] ....

View Replies View Related

LWJGL - Selecting Specific Region Of Image

Jan 20, 2014

I want to render a specific region of an image in LWJGL,

View Replies View Related

Export Runnable Jar File That Requires LWJGL

Aug 13, 2014

I'm trying to export a runnable jar file that requires lwjgl. Everything works in eclipse as I'm using

-Djava.library.path=nativewindows

as a VM Argument for the jinput .dll files.

After exporting & launching the jar it doesn't work of course! I get this error:

java.lang.UnsatisfiedLinkError: no junput-dx8 in java.library.path

I'm not sure how to make it work outside of eclipse....

View Replies View Related

3D Graphics - Inaccurate Results Using GluLookAt (LWJGL)

Jun 16, 2014

I've recently started programming with lwjgl, playing around with some 3D graphics. I've built a house and now I'm trying to render a view looking straight onto the center of the roof, but with current configuration it's slightly off.

As you can see in the image the edges on the roof aren't perfetly straight which would be the case if I was looking straight to the center from a point on the roof normal vector. I'm using gluLookAt to get the view, using the following code:

gluLookAt(house.getRoofCenter().x + house.getRoofNormal().x * 0.25f,
house.getRoofCenter().y + house.getRoofNormal().y * 0.25f,
house.getRoofCenter().z + house.getRoofNormal().z * 0.25f,
house.getRoofCenter().x, house.getRoofCenter().y, house.getRoofCenter().z, 0.0f, 1.0f, 0.0f);

And for the normals:

Vector3f.sub(p2, p1, a);
Vector3f.sub(p3, p1, B)/>/>/>;
Vector3f.cross(a, b, c);
roofNormal = new Vector3f(-c.x, -c.y, -c.z);

and center:

roofCenter = new Vector3f((p3.x + p1.x) / 2, (p3.y + p1.y) / 2, (p3.z + p1.z) / 2);

My question is: Is this due to errors in the rendering methods or is my math off?

View Replies View Related

LWJGL - Minecraft Clone / Drawing Just ONE Simple Dirt Block

Feb 21, 2015

I am currently working on a Minecraft clone (called "Build"), and I'm trying draw just ONE simple dirt block, but it will only draw a square!

Here is the main class:

package game;
 import game.block.DirtBlock;
 import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GL11;
 
[Code] ....

And the Block class ( the one that all Block Types are based off of):

package game;
 import static org.lwjgl.opengl.GL11.*;
 import java.io.IOException;
import java.nio.FloatBuffer;
 import org.lwjgl.opengl.GL11;
import org.newdawn.slick.opengl.Texture;
import org.newdawn.slick.opengl.TextureLoader;
import org.newdawn.slick.util.ResourceLoader;
 
[Code] ....

And that is the code, I'll make updates as needed.

View Replies View Related

Servlets :: Not Mapping To URL

Feb 4, 2015

I have a servlet that is not mapping to my URL:

<servlet-mapping>
<servlet-name>view</servlet-name>
<url-pattern>/View/*</url-pattern>
</servlet-mapping>

When I try to call the Servlet from a JSP:

<a href="/View/viewFlow?V1">V1</a>

The resulting link is [URL].... It's bypassing the project name. The link should be [URL]...

View Replies View Related

Many To Many Relationship Mapping

Apr 21, 2014

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter pw = response.getWriter();
String connectionURL = "jdbc:mysql://localhost:3306/userdb";// userdb is the database
Connection connection;

[Code] .....

View Replies View Related

Int From Char Mapping

Apr 5, 2014

When casting a char which is read from a file to an int, can i assume that the mapping used will be ASCII? I've learned that unicode uses ASCII mappings for the characters that overlap.

Are there any other possibilities for int values of one character? I still have trouble understanding character encodings.

View Replies View Related

Mapping / Splitting A String

Nov 14, 2014

I am writing a program where I need to split an array of full names into First names and Surnames, using mapping. However, I am struggling how to split it up... and my First Names and Surnames list are both just displaying the full name.

public static void main(String[] args) {
String[] names;
names = new String[8];
Scanner s = new Scanner(System.in);
for (int i = 0; i < names.length; i++) {
System.out.println("Enter full student name:");

[Code] ....

View Replies View Related

Servlets :: Mapping Before Context Root

Dec 1, 2014

I have this mapping:

<servlet>
<servlet-name>wsdl</servlet-name>
<jsp-file>/wsdl/bankconnect.html</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>wsdl</servlet-name>
<url-pattern>/wsdl</url-pattern>
</servlet-mapping>

And this works fine: URL....The war file is deployed under the context root /bankconnect/ I want to make a servlet mapping, before the context root "i still want the context root bankconnect". URL....

View Replies View Related

Hash Mapping Algorithm In Java

Apr 13, 2015

I need a Example of a Hash Mapping Algorithm in Java. This Mapping Needs to do the following:

Map an Array of Strings, to integer values which correspond to each fruit

private String[] Fruit = {"Apple","Orange","Pear","Grapes"};

Apple: 1 + 1
---------------
Orange: 1+ 2
---------------
Pear: 1 + 3
---------------
Grapes: 1 + 4
---------------

I not sure where to start at the Moment...

View Replies View Related

XML :: Process Big XML Files And Mapping To Objects

Dec 1, 2014

We need to process (read and parse) big xml files (500 Mo to 1 or 2 Go). What's the best framework or Java library to use for this requirement ? Then what's a good OXM (in this case xml to object mapping) solution for this kind of file ?

View Replies View Related

Servlets :: Web Application Access - Mapping Of Localhost

Feb 14, 2014

We generally use [URL] ..... for running web applications.

What I want is to access my web app using something like this: [URL] ....

How to achieve this? Actually what i want to ask is that how URL like WWW.example.com is mapped to web applications? Assuming that i am using tomcat server.

View Replies View Related

Testing Two Mapping Libraries - Orika Vs JMapper

Feb 27, 2014

I have downloaded and testing these two mapping libraries. I wrote a program which has 100000 iterations and maps the beans of the same class:

public class IntBean {
 
    @JMap
    private int int1;
    @JMap
    private int int2;

[Code] ....
 
Mappers are created BEFORE iterations start:
 
    private JMapper jmapper = new JMapper(IntBean.class, IntBean.class);
    private MapperFactory orikaFactory = new DefaultMapperFactory.Builder().build();
    private MapperFacade orikaFacade = null;
orikaFactory.registerClassMap(orikaFactory.classMap(IntBean.class,IntBean.class).byDefault().toClassMap());    orikaFacade = orikaFactory.getMapperFacade(); 

What is in each iteration:this.orikaFacade.map(a1, a2);
or
a2 =  (A) this.jmapper2.getDestination(a1);
 
I know, that Orika and Jmapper are great libraries from Google and they use reflection in a different way than for example Dozer, which is much slower, they se reflection to generete code somehow..

I have 3 questions:

1) How they work - when the code is generated, during maven build, in runtime - everytime when I create mapper in code? Are they change class code byte dynamically?
2) Why there is this speed difference that I noticed?
3) Which library would you choose and why? Both have the same capabilities? Why both come from Google? Why Google didnt develop Orika and created Jmapper instead?

View Replies View Related

Servlets :: ROOT Mapping Causes Static Files To Not Be Served

Mar 16, 2015

When I map my servlet to the ROOT of the site, the javascript, CSS and image files are not served. The conversation between the server and browser shows the files are being sent, but they are not rendered in the browser. This happens in both Firefox and Chrome.

If I change the mapping to anything other than the root, such as /x/, everything works as it should.

Here's my web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">

[Code] .....

View Replies View Related

Web Services :: URI Mapping - Container Always Decides To Match It To Path

Dec 7, 2014

So, i got the following code:

@Path("{bill-id}/request")
@Path("{user-id}")

and the following pattern

myhost/c15a856/request

somehow, the container always decides to match it to @Path("{user-id}"). How do I resolve this

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved